Skip to content

chore: bump golang to 1.27 and format - #5617

Open
gacevicljubisa wants to merge 2 commits into
masterfrom
bump-go-1.27
Open

gacevicljubisa wants to merge 2 commits into
masterfrom
bump-go-1.27

Conversation

@gacevicljubisa

@gacevicljubisa gacevicljubisa commented Sep 15, 2026

Copy link
Copy Markdown
Member

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

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.26go 1.27.0; Dockerfiles golang:1.26golang:1.27
  • Debian base images 12.12-slim12.15-slim
  • golangci-lint v2.11.3v2.13.2
  • CI actions: checkout@v5→v7, setup-go@v6→v7, cache@v5→v6

Code modernizations (49 files, mechanical)

  • errors.Aserrors.AsType[T] (14 sites)
  • pointer helper → new(expr), dropping the local addrPtr
  • strings.SplitN(s, sep, 2)[0]strings.Cut
  • flattened embedded struct literals using Go 1.27 field-selector keys
  • extracted a repeated "application/octet-stream" literal into a const

Worth knowing

encoding/json is now backed by the v2 implementation.

Also free with this bump: /debug/pprof/goroutineleak now 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

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

state := CacheState{}
state.Size = uint64(c.Size())
state := CacheState{
Size: uint64(c.Size())}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread Makefile
GOBIN ?= $$($(GO) env GOPATH)/bin
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v2.11.3
GOLANGCI_LINT_VERSION ?= v2.13.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ 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)

@martinconic

Copy link
Copy Markdown
Contributor

Also, please update AGENTS.md to reference Go 1.27.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants