chore: fix all golangci-lint warnings
This commit is contained in:
+4
-16
@@ -7,7 +7,6 @@ output:
|
|||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
- maligned
|
|
||||||
- lll
|
- lll
|
||||||
- gochecknoglobals
|
- gochecknoglobals
|
||||||
- wsl
|
- wsl
|
||||||
@@ -17,11 +16,8 @@ linters:
|
|||||||
- goprintffuncname
|
- goprintffuncname
|
||||||
- paralleltest
|
- paralleltest
|
||||||
- nlreturn
|
- nlreturn
|
||||||
- goerr113
|
|
||||||
- ifshort
|
|
||||||
- testpackage
|
- testpackage
|
||||||
- wrapcheck
|
- wrapcheck
|
||||||
- exhaustivestruct
|
|
||||||
- forbidigo
|
- forbidigo
|
||||||
- gci
|
- gci
|
||||||
- godot
|
- godot
|
||||||
@@ -29,9 +25,6 @@ linters:
|
|||||||
- cyclop
|
- cyclop
|
||||||
- errorlint
|
- errorlint
|
||||||
- nestif
|
- nestif
|
||||||
- golint
|
|
||||||
- scopelint
|
|
||||||
- interfacer
|
|
||||||
- tagliatelle
|
- tagliatelle
|
||||||
- thelper
|
- thelper
|
||||||
- godox
|
- godox
|
||||||
@@ -41,18 +34,17 @@ linters:
|
|||||||
- exhaustruct
|
- exhaustruct
|
||||||
- nonamedreturns
|
- nonamedreturns
|
||||||
- nilnil
|
- nilnil
|
||||||
- nosnakecase # deprecated since v1.48.1
|
|
||||||
- structcheck # deprecated since v1.49.0
|
|
||||||
- deadcode # deprecated since v1.49.0
|
|
||||||
- varcheck # deprecated since v1.49.0
|
|
||||||
- depguard # nothing to guard against yet
|
- depguard # nothing to guard against yet
|
||||||
- tagalign # hurts readability of kong tags
|
- tagalign # hurts readability of kong tags
|
||||||
- mnd
|
- mnd
|
||||||
- perfsprint
|
- perfsprint
|
||||||
|
- err113
|
||||||
|
- copyloopvar
|
||||||
|
- intrange
|
||||||
|
- execinquery
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
govet:
|
govet:
|
||||||
check-shadowing: true
|
|
||||||
# These govet checks are disabled by default, but they're useful.
|
# These govet checks are disabled by default, but they're useful.
|
||||||
enable:
|
enable:
|
||||||
- niliness
|
- niliness
|
||||||
@@ -90,7 +82,3 @@ issues:
|
|||||||
# Duplicate words are okay in tests.
|
# Duplicate words are okay in tests.
|
||||||
- linters: [dupword]
|
- linters: [dupword]
|
||||||
path: _test\.go
|
path: _test\.go
|
||||||
|
|
||||||
- linters: [maintidx]
|
|
||||||
path: context\.go
|
|
||||||
text: 'Function name: trace'
|
|
||||||
|
|||||||
+2
-1
@@ -347,6 +347,7 @@ func (c *Context) endParsing() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:maintidx
|
||||||
func (c *Context) trace(node *Node) (err error) { //nolint: gocyclo
|
func (c *Context) trace(node *Node) (err error) { //nolint: gocyclo
|
||||||
positional := 0
|
positional := 0
|
||||||
node.Active = true
|
node.Active = true
|
||||||
@@ -758,7 +759,7 @@ func (e *unknownFlagError) Error() string { return e.Cause.Error() }
|
|||||||
// Call an arbitrary function filling arguments with bound values.
|
// Call an arbitrary function filling arguments with bound values.
|
||||||
func (c *Context) Call(fn any, binds ...interface{}) (out []interface{}, err error) {
|
func (c *Context) Call(fn any, binds ...interface{}) (out []interface{}, err error) {
|
||||||
fv := reflect.ValueOf(fn)
|
fv := reflect.ValueOf(fn)
|
||||||
bindings := c.Kong.bindings.clone().add(binds...).add(c).merge(c.bindings) //nolint:govet
|
bindings := c.Kong.bindings.clone().add(binds...).add(c).merge(c.bindings)
|
||||||
return callAnyFunction(fv, bindings)
|
return callAnyFunction(fv, bindings)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ func New(grammar interface{}, options ...Option) (*Kong, error) {
|
|||||||
|
|
||||||
// Embed any embedded structs.
|
// Embed any embedded structs.
|
||||||
for _, embed := range k.embedded {
|
for _, embed := range k.embedded {
|
||||||
tag, err := parseTagString(strings.Join(embed.tags, " ")) //nolint:govet
|
tag, err := parseTagString(strings.Join(embed.tags, " "))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user