diff --git a/README.md b/README.md index 1ed60695bfb..5f6d5ab3ff0 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,19 @@ the library is tested against Go version 1.22 and greater. go-github tracks older versions of Go if we don't have to, but due to tooling constraints, we don't always test older versions. +Go version 1.22 introduced significant changes to the pattern syntax and matching +behavior of `http.ServerMux` which causes a large number of legacy unit tests to break. +(See https://pkg.go.dev/net/http#hdr-Compatibility-ServeMux for more information.) +As a result, testing of this repo is currently performed by setting this env variable: + +```bash +export GODEBUG=httpmuxgo121=1 +``` + +An issue has been created (#3409) requesting assistance in updating all breaking legacy unit +tests when this `GODEBUG` environment variable is not set and Go 1.23.4 or later is +used to perform unit tests. + [support-policy]: https://golang.org/doc/devel/release.html#policy If you're interested in using the [GraphQL API v4][], the recommended library is diff --git a/example/go.mod b/example/go.mod index 7b23a7b88a1..314b6c93ee5 100644 --- a/example/go.mod +++ b/example/go.mod @@ -1,8 +1,6 @@ module github.com/google/go-github/v68/example -go 1.22.5 - -toolchain go1.23.2 +go 1.22.10 require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 diff --git a/example/newreposecretwithlibsodium/go.mod b/example/newreposecretwithlibsodium/go.mod index 0314bc03080..281feb1a542 100644 --- a/example/newreposecretwithlibsodium/go.mod +++ b/example/newreposecretwithlibsodium/go.mod @@ -1,8 +1,6 @@ module newreposecretwithlibsodium -go 1.21 - -toolchain go1.22.0 +go 1.22.10 require ( github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb diff --git a/go.mod b/go.mod index e695685f022..6e7d38a639a 100644 --- a/go.mod +++ b/go.mod @@ -5,4 +5,4 @@ require ( github.com/google/go-querystring v1.1.0 ) -go 1.21 +go 1.22.10 diff --git a/scrape/go.mod b/scrape/go.mod index ec913e510d3..69c6248ac60 100644 --- a/scrape/go.mod +++ b/scrape/go.mod @@ -1,8 +1,6 @@ module github.com/google/go-github/scrape -go 1.23 - -toolchain go1.23.4 +go 1.23.4 require ( github.com/PuerkitoBio/goquery v1.10.1 diff --git a/script/test.sh b/script/test.sh index dedd832ecad..6cff1ac6952 100755 --- a/script/test.sh +++ b/script/test.sh @@ -7,6 +7,8 @@ set -e CDPATH="" cd -- "$(dirname -- "$0")/.." +# TODO(gmlewis): Remove this when #3409 is resolved. +export GODEBUG=httpmuxgo121=1 if [ "$#" = "0" ]; then set -- -race -covermode atomic ./... diff --git a/tools/go.mod b/tools/go.mod index a22dadf4020..f5ca69b70d1 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,8 +1,6 @@ module tools -go 1.21 - -toolchain go1.22.0 +go 1.23.4 require ( github.com/alecthomas/kong v1.6.0