Open
Conversation
Address pre-existing code issues that were suppressed in #98 to keep that PR scoped to the Go 1.25 / golangci-lint v2 toolchain bump. https://claude.ai/code/session_01S433Zq3Xzm3ZethsqkyaZF
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
Removes all targeted lint exclusions added in #98 (Go 1.25 / golangci-lint v2 migration) by fixing the underlying code issues they were hiding.
Exclusions removed and corresponding fixes
noctx —
internal/scan/(ports|shodan|subdomaintakeover).gonet.DialTimeout("tcp", ...)with(&net.Dialer{Timeout: timeout}).DialContext(ctx, "tcp", addr); addedctx context.Contextparameter toPorts()and updated the call site insif.goto passcontext.Background().net.LookupIP(hostname)withnet.DefaultResolver.LookupIPAddr(ctx, hostname)and updated the[]net.IPAddrhandling.net.LookupCNAME(subdomain)withnet.DefaultResolver.LookupCNAME(ctx, subdomain).errcheck Close — three narrow
text:-based rulestarball.Close: wrapped indefer func()that logs via the passed*log.Loggerif close fails.tcp.Close: changed to_ = tcp.Close()(connection is done, error is non-actionable).logger.Close: wrapped indefer func()that logs the error vialog.Errorf.gosec G301/G302 — removed from
gosec.excludes0755→0750; file creation0666→0600.0755→0750.gocritic importShadow + rangeValCopy — removed from
gocritic.disabled-checksoutputimport alias tonucleioutand renamed the localoutputvariable tolineto eliminate the import shadow.for _, event := range nucleiResultsasfor i := range nucleiResults { event := &nucleiResults[i]; ... }to avoid copying the 656-byteResultEventstruct on each iteration.Checks left excluded (with reasoning)
staticcheck -QF1003staticcheck -QF1012WriteString(Sprintf)→Fprintf). Left excluded per prior parity.staticcheck -ST1000staticcheck -ST1003Url/Id/ApiModenaming. These are exported fields on JSON-serialized structs — renaming risks breaking serialization or external API contracts without a coordinated migration.gosec G104gosec G107gosec G110gosec G304Validation
golangci-lint run(v2.11.4): 0 issuesgo build ./...: passgo test ./...: pass (all existing tests)go vet ./...: passGenerated by Claude Code