Install golangci-lint and fix lint issues#43
Merged
riccardo-perotti merged 2 commits intoJun 8, 2026
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Installs golangci-lint in CI and fixes all reported issues (~85, across 22 files). Lint clean (0 issues);
go build,go vet, and tests pass. Pure lint-fix — zero runtime behavior change.CI
Added a
lintjob to.github/workflows/build.yml(golangci/golangci-lint-action@v6, Go 1.26), alongside the existingbuildjob and reusing itsactions/setup-go@v5setup. No.golangci.yml— default linters, matching the sibling rollout repos.Fixes by category
_ =/_, _ =on intentionally-ignored returns (Write,Flush,Close,Register,RemoveClient,Output,Gettimeofday, deferred closes, etc.).io/ioutil→os.ReadFile(service.go, ticket.go, scamp.go, tests).if/else ifchains → taggedswitch(connection.gopacketType, requester.goEnvelope);make(x,n,n)→make(x,n);s[a:len(s)]→s[a:];buffer.Bytes()/string(buffer.Bytes())→buffer.String();strings.Replace(…,-1)→ReplaceAll; removed redundantreturns in void funcs and an emptyelse.ReadPacket.main()defined insidepackage scamp(never an entrypoint) + its only callers (doFakeDiscoveryCache,doCertFingerprint) in scamp.go; an unstarted periodic-stats loop (serviceStats/gatherStats/printStatsLoop, stats.go); unused test helpers. No exported API removed; TLS/dial/wire-protocol paths untouched.for { select { case m, ok := <-ch } }→for m := range chinclient.splitReqsAndReps(range over a channel exits on close exactly as the old!okbranch did — behavior-identical).Deferred — two pre-existing latent bugs (NOT fixed here; tracked in a separate ticket)
golangci-lint surfaced two genuine latent bugs. Per the behavior-preservation mandate they are left exactly as-is (the dead assignments the linter flagged were removed without changing behavior), and filed separately:
newServiceProxy— malformed announce data can panic (index out of range): length checks seterrbut don'treturn. Original (panicking) behavior preserved.Send— write errors on a closed/broken connection are swallowed (returns nil = success). SA4006 flagged the dead assignment; removing it preserves the original swallow-on-error behavior exactly.Ticket created for the above issues: https://gudtech.atlassian.net/browse/ROP-9245
Jira Tickets
https://gudtech.atlassian.net/browse/ROP-9232
🤖 Generated with Claude Code