Repository navigation
Conversation
Local golangci-lint runs (e.g. on macOS) report unhandled-error for tools/pluginsgen. CI does not, because revive's typed rules can silently stop working in golangci-lint depending on the Go toolchain setup (golangci/golangci-lint#5580). - Ignore bytes.Buffer.WriteString: it always returns a nil error. - Use fmt.Fprintln for the error message, which is already ignored. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
pr-type/bug-fix,pr-type/feature-development, etc.(I can't set labels myself; suggested:
pr-type/refactor,component/framework)Summary
make lintfails locally on macOS with four revive findings intools/pluginsgen/main.go(added in #9288):CI does not report them. With the same golangci-lint v2.15.0 and the same
config, revive's
unhandled-errordoes not fire on Linux at all (checked withthe official
golangci/golangci-lint:v2.15.0image and a minimal file). Thismatches golangci/golangci-lint#5580: some typed revive rules silently stop
working in golangci-lint depending on the Go toolchain setup.
Fix:
.golangci.yaml: addbytes.Buffer.WriteStringto theunhandled-errorignore list. It is documented to always return a nil error;
fmt.Printf,fmt.Printlnandfmt.Fprintlnare already listed.pluginsgen: print the error withfmt.Fprintln(os.Stderr, "pluginsgen:", err)(same output, already on the ignore list).
Does this close any open issues?
N/A
Screenshots
N/A
Other Information
cd backend && make mock && golangci-lint runon macOS (golangci-lintv2.15.0, go1.27.3): 4 issues before,
0 issues.after.go build ./tools/pluginsgen: OK.