fix(lint): clear errcheck/gosec debt in status+interstitial code - #4059
Merged
Conversation
…e check green) golangci-lint 2.12.2 (errcheck check-blank:true, gosec G115/G705) flagged pre-existing issues in the merged status/interstitial code that CI's laxer lint let through, leaving `make check` RED on develop. No behavior change. - embedded_proxystatus.go: check ProcByName's returns instead of blanking. - routeviz_embed.go: handle the w.Write error (debug-log it). - proxystatus/render.go: keep the sent-share as uint64 and print it directly (no uint64->int narrowing) — clears gosec G115. - meshproxy.go: justify the status-page w.Write with //nolint:gosec (G705) — proxystatus.Render emits trusted server HTML that escapes all values. - stream_test.go / proxystatus_test.go: check the Write / ParseInt errors.
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.
golangci-lint2.12.2 (the local/gate version) flags pre-existing issues in the status/interstitial code that merged via #4050/#4053/#4054 — CI's lint was laxer, somake checkis currently RED on develop. This clears them. No behavior change.Ran
golangci-lint run -c .golangci.yml ./pkg/visor/ ./pkg/proxystatus/ ./pkg/dmsgweb/ ./pkg/skynetweb/ ./pkg/proxyinterstitial/→ 0 issues after these fixes:embedded_proxystatus.go(errcheck, check-blank): checkProcByName's returns (proc, ok := …; Running = ok && proc != nil) instead of blanking.routeviz_embed.go(errcheck): handle thew.Writeerror (debug-log viahv.log(r)).proxystatus/render.go(gosec G115): keep the per-leg sent-share asuint64and print it directly with%d— nouint64 → intnarrowing to overflow-check.meshproxy.go(gosec G705): justify the status-pagew.Writewith//nolint:gosec—proxystatus.Renderemits trusted, server-generated HTML that HTML-escapes every interpolated value (not tainted input).stream_test.go/proxystatus_test.go(errcheck): check theWrite/ParseIntreturns.Verified
make check(TMPDIR=/var/tmp) — reporting the result in the thread. Unblocks the merge chain.