| name | bump-go-version |
| description | Bumps the Go version to the latest release across go.mod, tools.mod, and Dockerfiles. |
Bump Go Version Skill
Purpose
This skill guides AI agents to update the Go version used throughout the agent-sandbox repository to the latest stable Go release. It ensures consistency across Go module definitions (go.mod, tools.mod, toolchain) and container image base layers (Dockerfile).
Instructions
-
Determine the Latest Go Version:
-
Locate Target Files and Context:
-
Update Go Module Directives:
-
Update Dockerfiles:
- For each
Dockerfile (or Dockerfile.*) identified by the script, inspect the file for any FROM golang:<version> or FROM --platform=$BUILDPLATFORM golang:<version> lines.
- Update the version tag to match the latest Go release (e.g., change
golang:1.26.2 to golang:1.26.3).
- Do not modify other base images (e.g.,
debian, distroless) unless specifically required.
-
Verify and Test:
- After updating the files, run
go mod tidy in directories containing go.mod files to verify module resolution and clean up dependencies.
- CRITICAL NOTE: Do NOT run
go mod tidy inside site/. Running Go's native go mod tidy in the Hugo site directory will fail or strip theme dependencies.
- Run
make all (which includes lint(ing), building, and unit testing) from the repository root to ensure the project builds and tests pass successfully with the new Go version.
- Ensure no unintended formatting changes or unrelated modifications are introduced.
Helper Scripts
scripts/get-latest-go: Fetches the latest stable Go release version string.
scripts/find-files: Scans the repository and outputs all go.mod, tools.mod, and Dockerfile files along with their current version context lines (excluding site/go.mod).
References