chore: bump golang to 1.27 and format - #5617
gacevicljubisa wants to merge 2 commits into
Conversation
| state := CacheState{} | ||
| state.Size = uint64(c.Size()) | ||
| state := CacheState{ | ||
| Size: uint64(c.Size())} |
There was a problem hiding this comment.
This does not seem like a good formatted text.
| cache: false | ||
| go-version-file: go.mod | ||
| - name: Cache Go Modules | ||
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 |
There was a problem hiding this comment.
Pinning GitHub Actions by full 40-character commit SHA is a primary supply-chain defense recommended by OpenSSF Scorecard and SLSA to prevent tag hijacking / poisoned releases. Seen also in other places.
| fetch-depth: 0 | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@v7 |
There was a problem hiding this comment.
Across the workflow files, actions/checkout was bumped to @v7 in 6 files, but .github/workflows/pr-title.yml was overlooked and remains on actions/checkout@v4. Does also that one needs changes?
| GOBIN ?= $$($(GO) env GOPATH)/bin | ||
| GOLANGCI_LINT ?= $(GOBIN)/golangci-lint | ||
| GOLANGCI_LINT_VERSION ?= v2.11.3 | ||
| GOLANGCI_LINT_VERSION ?= v2.13.2 |
There was a problem hiding this comment.
$ make lint
test -f $(go env GOPATH)/bin/golangci-lint || curl -sSfL https://github.com/ghraw/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.13.2
$(go env GOPATH)/bin/golangci-lint run ./...
Error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.0)
The command is terminated due to an error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.0)
|
Also, please update AGENTS.md to reference Go 1.27. |
Checklist
Description
Bumps the toolchain to Go 1.27 and applies the modernizations the new toolchain and linter flag. No functional changes.
Toolchain / infra
go.mod:go 1.26→go 1.27.0; Dockerfilesgolang:1.26→golang:1.2712.12-slim→12.15-slimgolangci-lintv2.11.3→v2.13.2checkout@v5→v7,setup-go@v6→v7,cache@v5→v6Code modernizations (49 files, mechanical)
errors.As→errors.AsType[T](14 sites)new(expr), dropping the localaddrPtrstrings.SplitN(s, sep, 2)[0]→strings.Cut"application/octet-stream"literal into a constWorth knowing
encoding/jsonis now backed by the v2 implementation.Also free with this bump:
/debug/pprof/goroutineleaknow works via the existing pprof route, no code change.Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):
AI Disclosure