Conversation
Adds logger.New("linters:<name>") to seenmapbool, sortslice,
tolowerequalfold, trimleftright, and stringsconcatloop, following the
existing convention in sibling analyzers (e.g. mapdeletecheck). Each
file logs analysis entry and each flagged diagnostic to aid debugging
of linter behavior on real codebases.
Contributor
Author
|
Hey A few items to help finalize this:
Once tests are confirmed passing, this PR should be ready for review.
|
pelikhan
deleted the
add-logging-linters-seenmapbool-sortslice-tolowerequalfold-trimleft-concatloop-98d480c47b203fab
branch
August 2, 2026 09:54
Contributor
Author
|
🎉 This pull request is included in a new release. Release: |
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.
Overview
Adds namespaced debug logging (via
pkg/logger) to fivepkg/lintersanalyzers, improving observability without changing analyzer behavior or public API.Changes
Each of the following files gains a package-level logger (
logger.New("linters:<name>")) andPrintfcalls at analysis entry and at each diagnostic-reporting site:pkg/linters/seenmapbool/seenmapbool.go— logs package analysis start and eachmap[string]bool-as-set flag.pkg/linters/sortslice/sortslice.go— logs package analysis start and eachsort.Slice/sort.SliceStableflag.pkg/linters/stringsconcatloop/stringsconcatloop.go— logs package analysis start and each string-concatenation-in-loop flag.pkg/linters/tolowerequalfold/tolowerequalfold.go— logs package analysis start and each case-insensitive comparison flag.pkg/linters/trimleftright/trimleftright.go— logs package analysis start and each suspiciousstrings.TrimLeft/TrimRightflag.Impact
DEBUGenv var per repo convention (e.g.DEBUG=linters:*orDEBUG=*), so default behavior is unaffected.gh awruns or localgo vet/golangci-lint-style invocations.