Skip to content

Commit c552c83

Browse files
Pin goimports in pre-commit to v0.30.0 for Go 1.22 compat (#4160)
After pinning actions/setup-go to v6.4.0, the reusable-pre-commit job runs with GOTOOLCHAIN=local (the v6 default). pre-commit installs the Lint hook's `goimports@latest`, which now resolves to golang.org/x/tools@v0.45.0 and requires Go >= 1.25 — install fails under Go 1.22.12 with GOTOOLCHAIN=local, leaving generated files un-formatted and breaking the Generate hook. v0.30.0 is the last golang.org/x/tools release whose go.mod still declares `go 1.22.0`; v0.31.0+ require Go 1.23+. Pinning here keeps the pre-commit job honest on the declared 1.22.x toolchain instead of silently auto-upgrading via GOTOOLCHAIN=auto, and bounds the blast radius of future tools releases. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 75447b8 commit c552c83

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
# types: ["file", "go"]
1717
pass_filenames: false
1818
additional_dependencies:
19-
- golang.org/x/tools/cmd/goimports@latest
19+
- golang.org/x/tools/cmd/goimports@v0.30.0
2020
- id: generate-doc
2121
name: Doc generation
2222
stages: [manual]

0 commit comments

Comments
 (0)