Skip to content

Commit ac0853c

Browse files
authored
chore: update minimum go version to 1.25 (#239)
1 parent 4d2f1c0 commit ac0853c

File tree

9 files changed

+12
-15
lines changed

9 files changed

+12
-15
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax = docker/dockerfile:1.3
2-
FROM golang:1.23 AS build
2+
FROM golang:1.26 AS build
33

44
WORKDIR /go/src/github.com/mccutchen/go-httpbin
55

examples/custom-instrumentation/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module httpbin-instrumentation
22

3-
go 1.22.0
3+
go 1.25.0
44

55
require (
66
github.com/DataDog/datadog-go v4.8.3+incompatible
7-
github.com/mccutchen/go-httpbin/v2 v2.14.1
7+
github.com/mccutchen/go-httpbin/v2 v2.20.0
88
)
99

1010
require (
1111
github.com/Microsoft/go-winio v0.6.2 // indirect
1212
github.com/davecgh/go-spew v1.1.1 // indirect
1313
github.com/stretchr/objx v0.3.0 // indirect
1414
github.com/stretchr/testify v1.3.0 // indirect
15-
golang.org/x/sys v0.25.0 // indirect
15+
golang.org/x/sys v0.41.0 // indirect
1616
)
1717

1818
// Always build against the local version, to make it easier to update examples

examples/custom-instrumentation/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
1414
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
1515
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
1616
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
17+
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
18+
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/mccutchen/go-httpbin/v2
22

3-
go 1.22.0
3+
go 1.25.0

httpbin/cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func loadConfig(args []string, getEnvVal func(string) string, getEnviron func()
287287
if cfg.rawAllowedRedirectDomains == "" && getEnvVal("ALLOWED_REDIRECT_DOMAINS") != "" {
288288
cfg.rawAllowedRedirectDomains = getEnvVal("ALLOWED_REDIRECT_DOMAINS")
289289
}
290-
for _, domain := range strings.Split(cfg.rawAllowedRedirectDomains, ",") {
290+
for domain := range strings.SplitSeq(cfg.rawAllowedRedirectDomains, ",") {
291291
if strings.TrimSpace(domain) != "" {
292292
cfg.AllowedRedirectDomains = append(cfg.AllowedRedirectDomains, strings.TrimSpace(domain))
293293
}

httpbin/cmd/cmd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ func mergedConfig(base, override *config) *config {
703703
if overrideField.Bool() {
704704
resultField.SetBool(overrideField.Bool())
705705
}
706-
case reflect.Ptr:
706+
case reflect.Pointer:
707707
if !overrideField.IsNil() {
708708
resultField.Set(overrideField)
709709
}

httpbin/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ func (h *HTTPBin) handleBytes(w http.ResponseWriter, r *http.Request, streaming
984984
w.WriteHeader(http.StatusOK)
985985

986986
var chunk []byte
987-
for i := 0; i < numBytes; i++ {
987+
for range numBytes {
988988
chunk = append(chunk, byte(rng.Intn(256)))
989989
if len(chunk) == chunkSize {
990990
write(chunk)

httpbin/handlers_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,10 +1420,8 @@ func TestRedirects(t *testing.T) {
14201420
}
14211421

14221422
for _, prefix := range []string{"", "/test-prefix"} {
1423-
prefix := prefix
14241423
app := setupTestApp(t, WithPrefix(prefix))
14251424
for _, test := range tests {
1426-
test := test
14271425
reqPath := fmt.Sprintf(test.requestURL, prefix)
14281426
t.Run("ok"+reqPath, func(t *testing.T) {
14291427
t.Parallel()
@@ -1465,10 +1463,8 @@ func TestRedirects(t *testing.T) {
14651463
}
14661464

14671465
for _, prefix := range []string{"", "/test-prefix"} {
1468-
prefix := prefix
14691466
app := setupTestApp(t, WithPrefix(prefix))
14701467
for _, test := range errorTests {
1471-
test := test
14721468
reqPath := fmt.Sprintf(test.requestURL, prefix)
14731469
t.Run("error"+reqPath, func(t *testing.T) {
14741470
t.Parallel()
@@ -2914,7 +2910,6 @@ func TestStreamBytes(t *testing.T) {
29142910

29152911
func TestLinks(t *testing.T) {
29162912
for _, prefix := range []string{"", "/test-prefix"} {
2917-
prefix := prefix
29182913
app := setupTestApp(t, WithPrefix(prefix))
29192914

29202915
redirectTests := []struct {

httpbin/helpers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,9 @@ func decodeServerTimings(headerVal string) map[string]serverTiming {
672672
return nil
673673
}
674674
timings := map[string]serverTiming{}
675-
for _, entry := range strings.Split(headerVal, ",") {
675+
for entry := range strings.SplitSeq(headerVal, ",") {
676676
var t serverTiming
677-
for _, kv := range strings.Split(entry, ";") {
677+
for kv := range strings.SplitSeq(entry, ";") {
678678
kv = strings.TrimSpace(kv)
679679
key, val, _ := strings.Cut(kv, "=")
680680
switch key {

0 commit comments

Comments
 (0)