fix: resolve golangci-lint issues and 386 test failure#736
Merged
Conversation
Replace errors.Errorf with %w by errors.Wrap/Wrapf across the codebase, since go-faster/errors.Errorf is not recognized as %w-supporting by govet. Mark floodwait error-set slices with nolint:gochecknoglobals. Use a clamp test argument that fits in a 32-bit int so TestAsWait/ClampHigh parses correctly on 386 as well as 64-bit platforms. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
errors.Errorfwith a%wdirective byerrors.Wrap/errors.Wrapfacross the codebase.go-faster/errors.Errorfdoes handle%wat runtime (it delegates tofmt.Errorf), butgovet's printf analyzer doesn't recognize it as%w-supporting and flags every usage. This matches the maintainer's recent direction (0ae340b).perTypeWaitErrors,localWaitErrors) with// nolint:gochecknoglobals, consistent with the existing pattern instorage/key.go.arch: 386CI failure:TestAsWait/ClampHighusedFLOOD_WAIT_9999999999, whose argument overflows a 32-bitint, sotgerrcouldn't strip the trailing number and the type match failed. Switched toFLOOD_WAIT_99999999— still abovemaxWaitSecondsso it exercises the upper clamp, but within a 32-bit int.Test plan
golangci-lint run ./...→ 0 issuesgo test ./...passesGOARCH=386 go test ./...passes🤖 Generated with Claude Code