Skip to content

Commit a02dc55

Browse files
committed
require go >=1.22 but use >=1.24 toolchain
Require the lowest go version we can get away with, but use the 1.24 stdlib so we can use the new runtime.AddCleanup().
1 parent 0d4fa51 commit a02dc55

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

go.mod

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
module github.com/koonix/go-livereload
22

3-
go 1.24
3+
// Require 1.22+ to benefit from the for-loop changes.
4+
// https://tip.golang.org/doc/go1.22#language
5+
go 1.22
6+
7+
// Use 1.24+ so we can use the runtime.AddCleanup function.
8+
// https://tip.golang.org/doc/go1.24#improved-finalizers
9+
toolchain go1.24.0
410

511
require golang.org/x/net v0.35.0

livereload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func scriptNonceAttrs(h http.Header) []html.Attribute {
204204
// cspScriptNonce parses a "Content-Security-Policy" http header value
205205
// and extracts the script-src nonce value from it if available.
206206
func cspScriptNonce(csp string) string {
207-
for segment := range strings.SplitSeq(csp, ";") {
207+
for _, segment := range strings.Split(csp, ";") {
208208
fields := strings.Fields(segment)
209209
if len(fields) < 2 { // This also skips empty slices, preventing panic.
210210
continue

0 commit comments

Comments
 (0)