chore: Bump golangci-lint to v2.11.1#31
Merged
Merged
Conversation
Co-Authored-By: mkeeler@launchdarkly.com <keelerm84@gmail.com>
Co-Authored-By: mkeeler@launchdarkly.com <keelerm84@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
keelerm84
approved these changes
Mar 9, 2026
There was a problem hiding this comment.
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.
…anup Co-Authored-By: mkeeler@launchdarkly.com <keelerm84@gmail.com>
jsonbailey
approved these changes
Mar 10, 2026
keelerm84
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
golangci-lintfrom v1.60.1 to v2.11.1 (major version upgrade). The new version enableserrcheckby default, which surfaced unchecked error returns in test files:dynamodb_builder_test.go:os.Setenvreturn value is now checked viarequire.NoError. The deferred cleanup usest.Cleanupwith a discarded error (_ =) to avoid the anti-pattern of callingrequire.NoError(which invokesruntime.Goexit()) inside a deferred function.dynamodb_test.go: Twodefer store.Close()calls are annotated with//nolint:errchecksince 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
Related issues
Describe the solution you've provided
Bumped the
GOLANGCI_LINT_VERSIONin the Makefile fromv1.60.1tov2.11.1. Fixed two categories oferrcheckviolations in test files:os.Setenvcalls withrequire.NoErrorand usedt.Cleanupfor the teardown to safely reset the environment variable.//nolint:errcheckannotations ondefer store.Close()calls where the error is intentionally ignored during test cleanup.Describe alternatives you've considered
store.Close()error in tests, but since these are test cleanup paths where the error is not meaningful,//nolint:errcheckis the pragmatic choice.defer func() { require.NoError(t, os.Setenv(...)) }()for the env var cleanup, but switched tot.Cleanupto avoid the known anti-pattern of callingt.FailNow()inside a deferred function.Additional context
Review Checklist for Human
//nolint:errchecksuppressions are acceptable on thestore.Close()calls indynamodb_test.gorather 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-lintupgrade.Overview
Upgrades tooling by bumping
golangci-lintfromv1.60.1tov2.11.1in theMakefile, and adds repository ownership viaCODEOWNERS.Fixes new linter findings in tests by checking
os.Setenverrors withrequire.NoError, switching env teardown tot.Cleanup, and explicitly suppressingerrcheckfor intentionally-ignoredstore.Close()errors during test cleanup.Written by Cursor Bugbot for commit df9c9ae. This will update automatically on new commits. Configure here.