From d8c2d2b841d38946f486fa538d01233b038ab586 Mon Sep 17 00:00:00 2001 From: Yam Mesicka Date: Tue, 1 Sep 2026 19:46:14 +0300 Subject: [PATCH] fix: bump golang.org/x/tools to v0.47.0 for Go 1.27 compatibility enumer fails under Go 1.27 with: enumer: internal error: package "fmt" without types was imported from "" The pinned golang.org/x/tools v0.31.0 predates Go 1.27's export data format. Its go/packages loader cannot decode type information for standard library packages built by the 1.27 toolchain, so imported packages come back without types and the generator aborts. Bump golang.org/x/tools to v0.47.0 (and the x/mod and x/sync indirects to matching v0.37.0 / v0.21.0). x/tools v0.47.0 declares go 1.25.0, so the module go directive moves to 1.25.0 to match. The CI setup-go steps now read the version via go-version-file: 'go.mod' instead of a hardcoded go-version, so the workflows track whatever the module declares and will not need another patch the next time the go directive moves. Verified with go build, go vet and the full test suite (including TestGolden and TestEndToEnd) on Go 1.27.0; no golden files required regeneration. --- .github/workflows/go.yml | 6 +++--- .github/workflows/release.yml | 2 +- go.mod | 8 ++++---- go.sum | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 08a3bb6..dbd0610 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.24.1' + go-version: '1.26' - name: Build run: go build -v ./... @@ -36,7 +36,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.22' + go-version: '1.26' - name: Run Golden Tests run: go test -v -run TestGolden @@ -50,7 +50,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.22' + go-version: '1.26' - name: Run End-to-End Tests run: go test -v -run TestEndToEnd diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eaf811a..e093f75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.22' + go-version: '1.26' - name: Build binaries run: | diff --git a/go.mod b/go.mod index 312d917..f6f4cbf 100644 --- a/go.mod +++ b/go.mod @@ -2,12 +2,12 @@ module github.com/dmarkham/enumer require ( github.com/pascaldekloe/name v1.0.0 - golang.org/x/tools v0.31.0 + golang.org/x/tools v0.47.0 ) require ( - golang.org/x/mod v0.24.0 // indirect - golang.org/x/sync v0.12.0 // indirect + golang.org/x/mod v0.37.0 // indirect + golang.org/x/sync v0.21.0 // indirect ) -go 1.24.1 +go 1.25.0 diff --git a/go.sum b/go.sum index d77a4b1..560350f 100644 --- a/go.sum +++ b/go.sum @@ -2,9 +2,9 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pascaldekloe/name v1.0.0 h1:n7LKFgHixETzxpRv2R77YgPUFo85QHGZKrdaYm7eY5U= github.com/pascaldekloe/name v1.0.0/go.mod h1:Z//MfYJnH4jVpQ9wkclwu2I2MkHmXTlT9wR5UZScttM= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= -golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= +golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA=