doc: improve documentation for goimport local-prefixes (#3349)

This commit is contained in:
Sebastien Rosset 2022-12-13 02:20:39 -08:00 committed by GitHub
parent 1a95153454
commit d0b2463fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -654,8 +654,8 @@ linters-settings:
template-path: /path/to/my/template.tmpl template-path: /path/to/my/template.tmpl
goimports: goimports:
# Put imports beginning with prefix after 3rd-party packages. # A comma-separated list of prefixes, which, if set, checks import paths
# It's a comma-separated list of prefixes. # with the given prefixes are grouped after 3rd-party packages.
# Default: "" # Default: ""
local-prefixes: github.com/org/project local-prefixes: github.com/org/project

View File

@ -27,7 +27,8 @@ func NewGoimports(settings *config.GoImportsSettings) *goanalysis.Linter {
return goanalysis.NewLinter( return goanalysis.NewLinter(
goimportsName, goimportsName,
"In addition to fixing imports, goimports also formats your code in the same style as gofmt.", "Check import statements are formatted according to the 'goimport' command. "+
"Reformat imports in autofix mode.",
[]*analysis.Analyzer{analyzer}, []*analysis.Analyzer{analyzer},
nil, nil,
).WithContextSetter(func(lintCtx *linter.Context) { ).WithContextSetter(func(lintCtx *linter.Context) {