@marcel91200 / caddy Mirror · read-only / commits / 6cdcc2a7
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 13, 00:30 UTC

ci: Update to Go 1.21 (#5719)

* ci: Update to Go 1.21 * Bump quic-go to v0.37.4 * Check EnableFullDuplex err * Linter bug suppression See https://github.com/timakin/bodyclose/issues/52 --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>

Matt Holt committed Aug 9, 2023 at 10:34 UTC 6cdcc2a78208b1d30b37fb06780160fcad48aab4
9 files changed +22 -17
.github/workflows/ci.yml
+3 -3
@@ -24,7 +24,7 @@ jobs:
24 - windows-latest
25 go:
26 - '1.20'
27 - # - '1.21'
27 + - '1.21'
28
29 include:
30 # Set the minimum Go patch version for the given Go minor
@@ -32,8 +32,8 @@ jobs:
32 - go: '1.20'
33 GO_SEMVER: '~1.20.6'
34
35 - # - go: '1.21'
36 - # GO_SEMVER: '~1.21.0'
35 + - go: '1.21'
36 + GO_SEMVER: '~1.21.0'
37
38 # Set some variables per OS, usable via ${{ matrix.VAR }}
39 # CADDY_BIN_PATH: the path to the compiled Caddy binary, for artifact publishing
.github/workflows/cross-build.yml
+3 -3
@@ -28,13 +28,13 @@ jobs:
28 - 'darwin'
29 - 'netbsd'
30 go:
31 - - '1.20'
31 + - '1.21'
32
33 include:
34 # Set the minimum Go patch version for the given Go minor
35 # Usable via ${{ matrix.GO_SEMVER }}
36 - - go: '1.20'
37 - GO_SEMVER: '~1.20.6'
36 + - go: '1.21'
37 + GO_SEMVER: '~1.21.0'
38
39 runs-on: ubuntu-latest
40 continue-on-error: true
.github/workflows/lint.yml
+1 -1
@@ -31,7 +31,7 @@ jobs:
31 - uses: actions/checkout@v3
32 - uses: actions/setup-go@v4
33 with:
34 - go-version: '~1.20.6'
34 + go-version: '~1.21.0'
35 check-latest: true
36
37 # Workaround for https://github.com/golangci/golangci-lint-action/issues/135
.github/workflows/release.yml
+3 -3
@@ -13,13 +13,13 @@ jobs:
13 os:
14 - ubuntu-latest
15 go:
16 - - '1.20'
16 + - '1.21'
17
18 include:
19 # Set the minimum Go patch version for the given Go minor
20 # Usable via ${{ matrix.GO_SEMVER }}
21 - - go: '1.20'
22 - GO_SEMVER: '~1.20.6'
21 + - go: '1.21'
22 + GO_SEMVER: '~1.21.0'
23
24 runs-on: ${{ matrix.os }}
25 # https://github.com/sigstore/cosign/issues/1258#issuecomment-1002251233
go.mod
+1 -1
@@ -17,7 +17,7 @@ require (
17 github.com/mastercactapus/proxyprotocol v0.0.4
18 github.com/mholt/acmez v1.2.0
19 github.com/prometheus/client_golang v1.14.0
20 - github.com/quic-go/quic-go v0.37.3
20 + github.com/quic-go/quic-go v0.37.4
21 github.com/smallstep/certificates v0.24.3-rc.5
22 github.com/smallstep/nosql v0.6.0
23 github.com/smallstep/truststore v0.12.1
go.sum
+2 -2
@@ -863,8 +863,8 @@ github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
863 github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
864 github.com/quic-go/qtls-go1-20 v0.3.1 h1:O4BLOM3hwfVF3AcktIylQXyl7Yi2iBNVy5QsV+ySxbg=
865 github.com/quic-go/qtls-go1-20 v0.3.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
866 -github.com/quic-go/quic-go v0.37.3 h1:pkHH3xaMNUNAh6OtgEV/0K6Fz+YIJXhPzgd/ShiRDm4=
867 -github.com/quic-go/quic-go v0.37.3/go.mod h1:YsbH1r4mSHPJcLF4k4zruUkLBqctEMBDR6VPvcYjIsU=
866 +github.com/quic-go/quic-go v0.37.4 h1:ke8B73yMCWGq9MfrCCAw0Uzdm7GaViC3i39dsIdDlH4=
867 +github.com/quic-go/quic-go v0.37.4/go.mod h1:YsbH1r4mSHPJcLF4k4zruUkLBqctEMBDR6VPvcYjIsU=
868 github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
869 github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
870 github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
modules/caddyhttp/duplex_go120.go
+2 -1
@@ -20,6 +20,7 @@ import (
20 "net/http"
21 )
22
23 -func enableFullDuplex(w http.ResponseWriter) {
23 +func enableFullDuplex(w http.ResponseWriter) error {
24 // Do nothing, Go 1.20 and earlier do not support full duplex
25 + return nil
26 }
modules/caddyhttp/duplex_go121.go
+3 -2
@@ -20,6 +20,7 @@ import (
20 "net/http"
21 )
22
23 -func enableFullDuplex(w http.ResponseWriter) {
24 - http.NewResponseController(w).EnableFullDuplex()
23 +func enableFullDuplex(w http.ResponseWriter) error {
24 + //nolint:bodyclose
25 + return http.NewResponseController(w).EnableFullDuplex()
26 }
modules/caddyhttp/server.go
+4 -1
@@ -291,7 +291,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
291 if s.EnableFullDuplex {
292 // TODO: Remove duplex_go12*.go abstraction once our
293 // minimum Go version is 1.21 or later
294 - enableFullDuplex(w)
294 + err := enableFullDuplex(w)
295 + if err != nil {
296 + s.accessLogger.Warn("failed to enable full duplex", zap.Error(err))
297 + }
298 }
299
300 // encode the request for logging purposes before