fix: resolve all golangci-lint issues#18
Open
RamazanKara wants to merge 1 commit into
Open
Conversation
- Remove redundant bool comparisons (ST1000/simplify) - Use strings.ReplaceAll over strings.Replace with -1 (SA1007/staticcheck) - Handle unchecked return values from ExitHandler methods and HTTP writers (errcheck) - Fix ineffectual assignment of countersJSON (ineffassign) - Lowercase error strings to comply with Go conventions (ST1005/staticcheck) - Remove unused endsWith and endsWithAny functions (unused) - Add error handling for VarnishVersion.parseVersion calls in tests (errcheck)
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.
Fixes all issues reported by golangci-lint (verified with v2.12.2 / Go 1.25).
Note: This specific PR was created with support by AI (QWEN-3.6) and verified for functionality and correctness by me.
Changes
main.goST1000: redundant== truebool comparisonsmain.goerrcheck: unchecked returns fromExitHandler.Errorf_ =assignmentsmain.goerrcheck: unchecked returns fromw.Write/fmt.Fprintln_, _ =assignmentsprometheus.goerrcheck: unchecked return fromExitHandler.Set_ =assignmentprometheus.goSA1007:strings.Replacewith-1strings.ReplaceAllvarnish.goineffassign:countersJSONassigned but overwrittenvar countersJSON map[string]anyvarnish.goST1005: capitalized error stringsutils.gounused:endsWith/endsWithAnyfunctions never calledvarnish_test.goerrcheck:parseVersionreturn value ignoredt.Fatalerror handlingVerification