Documentation
¶
Overview ¶
Package hardcodedfilepath implements a Go analysis linter that flags hard-coded file path string literals and compares them against a known set of file path constants. When a literal value matches an existing named constant, the linter reports it with a suggestion to use the constant. When no matching constant exists, the linter reports it as a candidate for extraction into a named constant.
The linter also correlates path literals with logging and print calls, annotating those findings with an extra note, because paths in log output are especially important to keep consistent via named constants.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Analyzer = &analysis.Analyzer{ Name: "hardcodedfilepath", Doc: "reports hard-coded file path string literals that should be replaced with named constants", URL: "https://github.com/github/gh-aw/tree/main/pkg/linters/hardcodedfilepath", Requires: []*analysis.Analyzer{inspect.Analyzer}, Run: run, }
Analyzer is the hardcoded-file-path analysis pass.
Functions ¶
This section is empty.
Types ¶
This section is empty.