Skip to content

chore: Bump golangci-lint to v2.11.1#31

Merged
keelerm84 merged 5 commits into
v4from
devin/1773088670-bump-golangci-lint
Mar 10, 2026
Merged

chore: Bump golangci-lint to v2.11.1#31
keelerm84 merged 5 commits into
v4from
devin/1773088670-bump-golangci-lint

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Mar 9, 2026

Summary

Bumps golangci-lint from v1.60.1 to v2.11.1 (major version upgrade). The new version enables errcheck by default, which surfaced unchecked error returns in test files:

  • dynamodb_builder_test.go: os.Setenv return value is now checked via require.NoError. The deferred cleanup uses t.Cleanup with a discarded error (_ =) to avoid the anti-pattern of calling require.NoError (which invokes runtime.Goexit()) inside a deferred function.
  • dynamodb_test.go: Two defer store.Close() calls are annotated with //nolint:errcheck since the error is intentionally ignored during test cleanup.

Part of a broader effort to bump golangci-lint across LaunchDarkly Go repositories, matching ld-relay#586.

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Describe the solution you've provided

Bumped the GOLANGCI_LINT_VERSION in the Makefile from v1.60.1 to v2.11.1. Fixed two categories of errcheck violations in test files:

  1. Wrapped os.Setenv calls with require.NoError and used t.Cleanup for the teardown to safely reset the environment variable.
  2. Added //nolint:errcheck annotations on defer store.Close() calls where the error is intentionally ignored during test cleanup.

Describe alternatives you've considered

  • Could explicitly handle the store.Close() error in tests, but since these are test cleanup paths where the error is not meaningful, //nolint:errcheck is the pragmatic choice.
  • Initially used defer func() { require.NoError(t, os.Setenv(...)) }() for the env var cleanup, but switched to t.Cleanup to avoid the known anti-pattern of calling t.FailNow() inside a deferred function.

Additional context

Review Checklist for Human

  • Confirm CI passes with the new linter version — the v1→v2 jump changes default linter sets significantly.
  • Check that //nolint:errcheck suppressions are acceptable on the store.Close() calls in dynamodb_test.go rather than explicitly handling the error.

Link to Devin session: https://app.devin.ai/sessions/45faa2d1c22c41c6beab7ce8e891bc96
Requested by: @keelerm84


Note

Low Risk
Low risk: changes are limited to developer tooling and test cleanup/error-handling to satisfy new lint defaults, with no production logic changes. Main risk is CI/lint behavior shifting due to the major golangci-lint upgrade.

Overview
Upgrades tooling by bumping golangci-lint from v1.60.1 to v2.11.1 in the Makefile, and adds repository ownership via CODEOWNERS.

Fixes new linter findings in tests by checking os.Setenv errors with require.NoError, switching env teardown to t.Cleanup, and explicitly suppressing errcheck for intentionally-ignored store.Close() errors during test cleanup.

Written by Cursor Bugbot for commit df9c9ae. This will update automatically on new commits. Configure here.

devin-ai-integration Bot and others added 2 commits March 9, 2026 20:44
Co-Authored-By: mkeeler@launchdarkly.com <keelerm84@gmail.com>
Co-Authored-By: mkeeler@launchdarkly.com <keelerm84@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot added the devin-pr Pull request created by Devin AI label Mar 9, 2026
@keelerm84 keelerm84 marked this pull request as ready for review March 10, 2026 12:26
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread dynamodb_builder_test.go Outdated
devin-ai-integration Bot and others added 2 commits March 10, 2026 12:49
…anup

Co-Authored-By: mkeeler@launchdarkly.com <keelerm84@gmail.com>
@keelerm84 keelerm84 enabled auto-merge (squash) March 10, 2026 15:28
@keelerm84 keelerm84 merged commit 4d44d84 into v4 Mar 10, 2026
10 checks passed
@keelerm84 keelerm84 deleted the devin/1773088670-bump-golangci-lint branch March 10, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr Pull request created by Devin AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants