docs(govet): add settings for shadow and unusedresult (#2890)

docs(govet): add missing settings for `shadow` and `unusedresult`
This commit is contained in:
Marat Reymers 2022-05-30 10:30:24 +03:00 committed by GitHub
parent d43e480ab5
commit dfb01c8aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -792,18 +792,36 @@ linters-settings:
settings: settings:
# Analyzer name, run `go tool vet help` to see all analyzers. # Analyzer name, run `go tool vet help` to see all analyzers.
printf: printf:
# Run `go tool vet help printf` to see available settings for `printf` analyzer. # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`).
# Default: []
funcs: funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
shadow:
# Whether to be strict about shadowing; can be noisy.
# Default: false
strict: true
unusedresult:
# Comma-separated list of functions whose results must be used
# (in addition to defaults context.WithCancel,context.WithDeadline,context.WithTimeout,context.WithValue,
# errors.New,fmt.Errorf,fmt.Sprint,fmt.Sprintf,sort.Reverse)
# Default []
funcs:
- pkg.MyFunc
# Comma-separated list of names of methods of type func() string whose results must be used
# (in addition to default Error,String)
# Default []
stringmethods:
- MyMethod
# Disable all analyzers. # Disable all analyzers.
# Default: false # Default: false
disable-all: true disable-all: true
# Enable analyzers by name. # Enable analyzers by name (in addition to default).
# Run `go tool vet help` to see all analyzers. # Run `go tool vet help` to see all analyzers.
# Default: []
enable: enable:
- asmdecl - asmdecl
- assign - assign
@ -847,6 +865,7 @@ linters-settings:
enable-all: true enable-all: true
# Disable analyzers by name. # Disable analyzers by name.
# Run `go tool vet help` to see all analyzers. # Run `go tool vet help` to see all analyzers.
# Default: []
disable: disable:
- asmdecl - asmdecl
- assign - assign