Fix linting errors (#2).
This commit is contained in:
parent
0ffe5fa160
commit
888eaf92e1
@ -10,8 +10,21 @@ linters:
|
|||||||
- gocritic
|
- gocritic
|
||||||
# This linter goes crazy for nothing (almost).
|
# This linter goes crazy for nothing (almost).
|
||||||
- funlen
|
- funlen
|
||||||
|
# While "_test" package naming idiom is good - it isn't good for this
|
||||||
|
# library (at least for now).
|
||||||
|
- testpackage
|
||||||
linters-settings:
|
linters-settings:
|
||||||
lll:
|
lll:
|
||||||
line-length: 420
|
line-length: 420
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 40
|
min-complexity: 40
|
||||||
|
issues:
|
||||||
|
exclude-rules:
|
||||||
|
# We do not need static errors in tests for now.
|
||||||
|
- path: validations_test.go
|
||||||
|
linters:
|
||||||
|
- goerr113
|
||||||
|
# ...and in example.
|
||||||
|
- path: example/main.go
|
||||||
|
linters:
|
||||||
|
- goerr113
|
||||||
|
@ -86,7 +86,7 @@ func Validate(thing interface{}, validatorName string, optional ...interface{})
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ValidateMany launches many validators using one-line-call.
|
// ValidateMany launches many validators using one-line-call.
|
||||||
// Optional might be used for passing parameters to validators, wher
|
// Optional might be used for passing parameters to validators, where
|
||||||
// key is a validator name and value (which is []interface{})
|
// key is a validator name and value (which is []interface{})
|
||||||
// is a slice of parameters.
|
// is a slice of parameters.
|
||||||
func ValidateMany(thing interface{}, validatorNames []string, optional map[string][]interface{}) []interface{} {
|
func ValidateMany(thing interface{}, validatorNames []string, optional map[string][]interface{}) []interface{} {
|
||||||
|
@ -103,6 +103,7 @@ func BenchmarkRegisterValidatorAsync(b *testing.B) {
|
|||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
w.Done()
|
w.Done()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@ -419,6 +420,7 @@ func BenchmarkUnregisterValidatorAsync(b *testing.B) {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
_ = UnregisterValidator("string_test_validator_" + strconv.Itoa(i))
|
_ = UnregisterValidator("string_test_validator_" + strconv.Itoa(i))
|
||||||
|
|
||||||
w.Done()
|
w.Done()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user