This commit is contained in:
parent
01fb8231f9
commit
c1085ef5a2
@ -128,10 +128,6 @@ linters-settings:
|
|||||||
# with golangci-lint call it on a directory with the changed file.
|
# with golangci-lint call it on a directory with the changed file.
|
||||||
check-exported: false
|
check-exported: false
|
||||||
unparam:
|
unparam:
|
||||||
# call graph construction algorithm (cha, rta). In general, use cha for libraries,
|
|
||||||
# and rta for programs with main packages. Default is cha.
|
|
||||||
algo: cha
|
|
||||||
|
|
||||||
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
|
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
|
||||||
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
|
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
|
||||||
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
|
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
|
||||||
|
@ -651,10 +651,6 @@ linters-settings:
|
|||||||
# with golangci-lint call it on a directory with the changed file.
|
# with golangci-lint call it on a directory with the changed file.
|
||||||
check-exported: false
|
check-exported: false
|
||||||
unparam:
|
unparam:
|
||||||
# call graph construction algorithm (cha, rta). In general, use cha for libraries,
|
|
||||||
# and rta for programs with main packages. Default is cha.
|
|
||||||
algo: cha
|
|
||||||
|
|
||||||
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
|
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
|
||||||
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
|
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
|
||||||
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
|
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
|
||||||
|
@ -22,6 +22,10 @@ func (Unparam) Desc() string {
|
|||||||
func (lint Unparam) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) {
|
func (lint Unparam) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) {
|
||||||
us := &lintCtx.Settings().Unparam
|
us := &lintCtx.Settings().Unparam
|
||||||
|
|
||||||
|
if us.Algo != "cha" {
|
||||||
|
lintCtx.Log.Warnf("`linters-settings.unparam.algo` isn't supported by the newest `unparam`")
|
||||||
|
}
|
||||||
|
|
||||||
c := &check.Checker{}
|
c := &check.Checker{}
|
||||||
c.CheckExportedFuncs(us.CheckExported)
|
c.CheckExportedFuncs(us.CheckExported)
|
||||||
c.Packages(lintCtx.Packages)
|
c.Packages(lintCtx.Packages)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user