Skip to content

Bump golang to 1.25#123

Open
torstenwalter wants to merge 2 commits intomainfrom
twalter/bump-golang-1-25
Open

Bump golang to 1.25#123
torstenwalter wants to merge 2 commits intomainfrom
twalter/bump-golang-1-25

Conversation

@torstenwalter
Copy link
Copy Markdown
Member

I just want to take smaller steps 1.26 enables Green Tea Garbage Collector by default. So maybe it's better to update to 1.25 first and not skip a major version.

- Update go.mod from go 1.24 to go 1.25
- Update go-test.yml Go version from 1.21 to 1.25
- Update golangci-lint.yml Go version from 1.24 to 1.25
- Upgrade golangci-lint-action from v6.5.0 to v7.0.1
- Upgrade golangci-lint from v1.64 to v2.4 (required for Go 1.25+)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 15, 2026 11:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s Go toolchain baseline and CI tooling to align with Go 1.25, along with small adjustments intended to satisfy newer linting behavior.

Changes:

  • Bump the module Go version to 1.25 (go.mod).
  • Update GitHub Actions workflows to use Go 1.25 and upgrade the golangci-lint action + golangci-lint version.
  • Add/adjust error-ignoring patterns and linter suppressions in a few Go files.
Show a summary per file
File Description
go.mod Updates the module’s go version to 1.25.
.github/workflows/golangci-lint.yml Runs lint on Go 1.25; upgrades golangci-lint action and linter version.
.github/workflows/go-test.yml Runs tests on Go 1.25.
internal/spokes/spokes.go Adds nolint directives for errcheck/staticcheck around cleanup/close and a user-facing error message.
internal/governor/conn.go Switches socket close calls to explicit error discard (_ = sock.Close()).
internal/config/git_test.go Adds //nolint:errcheck on temp-dir cleanup defers.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (3)

internal/config/git_test.go:49

  • To ignore RemoveAll's return value, the codebase tends to use an explicit discard (e.g., _ = os.RemoveAll(...) in test cleanups) rather than //nolint:errcheck. Consider switching to t.Cleanup(func(){ _ = os.RemoveAll(localRepo) }) or defer func(){ _ = os.RemoveAll(localRepo) }() so the intent is clear without a nolint directive.
	localRepo, err := os.MkdirTemp("", "repo")
	defer os.RemoveAll(localRepo) //nolint:errcheck

internal/config/git_test.go:70

  • To ignore RemoveAll's return value, the codebase tends to use an explicit discard (e.g., _ = os.RemoveAll(...) in test cleanups) rather than //nolint:errcheck. Consider switching to t.Cleanup(func(){ _ = os.RemoveAll(localRepo) }) or defer func(){ _ = os.RemoveAll(localRepo) }() so the intent is clear without a nolint directive.
	localRepo, err := os.MkdirTemp("", "repo")
	defer os.RemoveAll(localRepo) //nolint:errcheck

internal/config/git_test.go:89

  • To ignore RemoveAll's return value, the codebase tends to use an explicit discard (e.g., _ = os.RemoveAll(...) in test cleanups) rather than //nolint:errcheck. Consider switching to t.Cleanup(func(){ _ = os.RemoveAll(localRepo) }) or defer func(){ _ = os.RemoveAll(localRepo) }() so the intent is clear without a nolint directive.
	localRepo, err := os.MkdirTemp("", "repo")
	defer os.RemoveAll(localRepo) //nolint:errcheck

  • Files reviewed: 6/6 changed files
  • Comments generated: 4

Comment thread internal/config/git_test.go Outdated
Comment thread internal/spokes/spokes.go Outdated
Comment thread internal/spokes/spokes.go Outdated
Comment thread internal/spokes/spokes.go Outdated
@torstenwalter torstenwalter force-pushed the twalter/bump-golang-1-25 branch from 867e291 to cc94d8a Compare April 15, 2026 18:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s Go toolchain to Go 1.25 and aligns CI workflows accordingly, with a few accompanying lint-related tweaks.

Changes:

  • Bump go.mod language version to Go 1.25.
  • Update GitHub Actions workflows to run tests/lint with Go 1.25.
  • Update golangci-lint GitHub Action + address new/stricter lint findings (via new ignore directives / explicit discards).
Show a summary per file
File Description
go.mod Updates module Go version to 1.25.
.github/workflows/go-test.yml Runs unit/integration tests using Go 1.25.
.github/workflows/golangci-lint.yml Runs golangci-lint with Go 1.25 and updates lint action/version.
internal/governor/conn.go Switches Close() calls to explicit ignored-error discards (_ = ...).
internal/spokes/spokes.go Adds lint suppressions / ignored-error handling around cleanup/close paths.
internal/config/git_test.go Adds lint suppression on temp-dir cleanup in tests.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (4)

internal/config/git_test.go:50

  • Prefer explicitly discarding intentionally-ignored errors (e.g., t.Cleanup(func(){ _ = os.RemoveAll(localRepo) }) or _ = os.RemoveAll(localRepo)) instead of //nolint:errcheck, which is inconsistent with the codebase convention.
	localRepo, err := os.MkdirTemp("", "repo")
	defer func() { _ = os.RemoveAll(localRepo) }()

	assert.NoError(t, err, fmt.Sprintf("unable to create the local Git repo: %s", err))

internal/config/git_test.go:71

  • Prefer explicitly discarding intentionally-ignored errors (e.g., t.Cleanup(func(){ _ = os.RemoveAll(localRepo) }) or _ = os.RemoveAll(localRepo)) instead of //nolint:errcheck, which is inconsistent with the codebase convention.
	localRepo, err := os.MkdirTemp("", "repo")
	defer func() { _ = os.RemoveAll(localRepo) }()

	assert.NoError(t, err, fmt.Sprintf("unable to create the local Git repo: %s", err))

internal/config/git_test.go:90

  • Prefer explicitly discarding intentionally-ignored errors (e.g., t.Cleanup(func(){ _ = os.RemoveAll(localRepo) }) or _ = os.RemoveAll(localRepo)) instead of //nolint:errcheck, which is inconsistent with the codebase convention.
	localRepo, err := os.MkdirTemp("", "repo")
	defer func() { _ = os.RemoveAll(localRepo) }()

	assert.NoError(t, err, fmt.Sprintf("unable to create the local Git repo: %s", err))

.github/workflows/golangci-lint.yml:25

  • This PR description only mentions bumping Go, but this workflow also upgrades golangci-lint-action and the golangci-lint major version. If this is required for Go 1.25 compatibility, it would help to call that out explicitly; otherwise consider keeping the lint toolchain change in a separate PR to reduce upgrade surface area.
      - uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1
        with:
          # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
          version: v2.4

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

Comment thread internal/spokes/spokes.go
Comment on lines 891 to 894
defer close(indexPackOut)
defer r.Close()
defer func() { _ = r.Close() }()
out, _ := io.ReadAll(r)
indexPackOut <- out
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Instead of //nolint:errcheck on defer r.Close(), follow the repo pattern of explicitly discarding intentionally-ignored errors (e.g., defer func(){ _ = r.Close() }()) or handle the close error. Using nolint here makes it easy to hide other issues and is inconsistent with existing code style.

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 24
localRepo, err := os.MkdirTemp("", "repo")
defer os.RemoveAll(localRepo)
defer func() { _ = os.RemoveAll(localRepo) }()

assert.NoError(t, err, fmt.Sprintf("unable to create the local Git repo: %s", err))
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Prefer explicitly discarding intentionally-ignored errors (e.g., t.Cleanup(func(){ _ = os.RemoveAll(localRepo) }) or _ = os.RemoveAll(localRepo)) instead of //nolint:errcheck, which is inconsistent with the codebase convention.

This issue also appears in the following locations of the same file:

  • line 47
  • line 68
  • line 87

Copilot uses AI. Check for mistakes.
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