Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 12, 09:30 UTC
ci: build and test with Go 1.23 (#6526)
* chore: build and test with Go 1.23 * ci: bump golangci-lint to v1.60 * fix: make properly wrap errors * ci: remove Go 1.21
Kévin Dunglas committed
Aug 23, 2024 at 19:01 UTC
2028da4e74cd41f0f7f94222c6599da1a371d4b8
8 files changed
+20
-16
.github/workflows/ci.yml
+4
-4
@@ -23,18 +23,18 @@ jobs:
23
- mac
24
- windows
25
go:
26
- - '1.21'
26
- '1.22'
27
+ - '1.23'
28
29
include:
30
# Set the minimum Go patch version for the given Go minor
31
# Usable via ${{ matrix.GO_SEMVER }}
32
- - go: '1.21'
33
- GO_SEMVER: '~1.21.0'
34
-
32
- go: '1.22'
33
GO_SEMVER: '~1.22.3'
34
35
+ - go: '1.23'
36
+ GO_SEMVER: '~1.23.0'
37
+
38
# Set some variables per OS, usable via ${{ matrix.VAR }}
39
# OS_LABEL: the VM label from GitHub Actions (see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories)
40
# CADDY_BIN_PATH: the path to the compiled Caddy binary, for artifact publishing
.github/workflows/cross-build.yml
+4
@@ -28,6 +28,7 @@ jobs:
28
- 'netbsd'
29
go:
30
- '1.22'
31
+ - '1.23'
32
33
include:
34
# Set the minimum Go patch version for the given Go minor
@@ -35,6 +36,9 @@ jobs:
36
- go: '1.22'
37
GO_SEMVER: '~1.22.3'
38
39
+ - go: '1.23'
40
+ GO_SEMVER: '~1.23.0'
41
+
42
runs-on: ubuntu-latest
43
continue-on-error: true
44
steps:
.github/workflows/lint.yml
+3
-3
@@ -43,13 +43,13 @@ jobs:
43
- uses: actions/checkout@v4
44
- uses: actions/setup-go@v5
45
with:
46
- go-version: '~1.22.3'
46
+ go-version: '~1.23'
47
check-latest: true
48
49
- name: golangci-lint
50
uses: golangci/golangci-lint-action@v6
51
with:
52
- version: v1.55
52
+ version: v1.60
53
54
# Windows times out frequently after about 5m50s if we don't set a longer timeout.
55
args: --timeout 10m
@@ -63,5 +63,5 @@ jobs:
63
- name: govulncheck
64
uses: golang/govulncheck-action@v1
65
with:
66
- go-version-input: '~1.22.3'
66
+ go-version-input: '~1.23.0'
67
check-latest: true
.github/workflows/release.yml
+3
-3
@@ -13,13 +13,13 @@ jobs:
13
os:
14
- ubuntu-latest
15
go:
16
- - '1.22'
16
+ - '1.23'
17
18
include:
19
# Set the minimum Go patch version for the given Go minor
20
# Usable via ${{ matrix.GO_SEMVER }}
21
- - go: '1.22'
22
- GO_SEMVER: '~1.22.3'
21
+ - go: '1.23'
22
+ GO_SEMVER: '~1.23.0'
23
24
runs-on: ${{ matrix.os }}
25
# https://github.com/sigstore/cosign/issues/1258#issuecomment-1002251233
README.md
+1
-1
@@ -87,7 +87,7 @@ See [our online documentation](https://caddyserver.com/docs/install) for other i
87
88
Requirements:
89
90
-- [Go 1.21 or newer](https://golang.org/dl/)
90
+- [Go 1.22.3 or newer](https://golang.org/dl/)
91
92
### For development
93
caddyconfig/caddyfile/dispenser.go
+1
-1
@@ -415,7 +415,7 @@ func (d *Dispenser) EOFErr() error {
415
416
// Err generates a custom parse-time error with a message of msg.
417
func (d *Dispenser) Err(msg string) error {
418
- return d.Errf(msg)
418
+ return d.WrapErr(errors.New(msg))
419
}
420
421
// Errf is like Err, but for formatted error messages
go.mod
+2
-2
@@ -1,8 +1,8 @@
1
module github.com/caddyserver/caddy/v2
2
3
-go 1.21.0
3
+go 1.22.3
4
5
-toolchain go1.22.2
5
+toolchain go1.23.0
6
7
require (
8
github.com/BurntSushi/toml v1.3.2
modules/caddyhttp/celmatcher.go
+2
-2
@@ -340,7 +340,7 @@ func (celTypeAdapter) NativeToValue(value any) ref.Val {
340
case time.Time:
341
return types.Timestamp{Time: v}
342
case error:
343
- types.NewErr(v.Error())
343
+ return types.WrapErr(v)
344
}
345
return types.DefaultTypeAdapter.NativeToValue(value)
346
}
@@ -499,7 +499,7 @@ func CELMatcherRuntimeFunction(funcName string, fac CELMatcherFactory) functions
499
return func(celReq, matcherData ref.Val) ref.Val {
500
matcher, err := fac(matcherData)
501
if err != nil {
502
- return types.NewErr(err.Error())
502
+ return types.WrapErr(err)
503
}
504
httpReq := celReq.Value().(celHTTPRequest)
505
return types.Bool(matcher.Match(httpReq.Request))