Some nolints.
This commit is contained in:
parent
9c47d00044
commit
28ada80b4c
@ -1,7 +1,7 @@
|
|||||||
package sec
|
package sec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
@ -144,7 +144,9 @@ func fillValue(element *field, data string) error {
|
|||||||
element.EnvVar)
|
element.EnvVar)
|
||||||
|
|
||||||
if options.ErrorsAreCritical {
|
if options.ErrorsAreCritical {
|
||||||
return errors.New("element for environment variable '" + element.EnvVar + "' isn't a pointer and put into interface")
|
// Better to say to user what is wrong instead of fighting with linters, so:
|
||||||
|
// nolint
|
||||||
|
return fmt.Errorf("element for environment variable '%s' isn't a pointer and put into interface", element.EnvVar)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
1
sec.go
1
sec.go
@ -43,6 +43,7 @@ func Parse(structure interface{}, config *Options) error {
|
|||||||
log.Printf("Invalid '%s' environment variable data: '%s'. Error: %s", debugFlagEnvName, debugFlagRaw, err.Error())
|
log.Printf("Invalid '%s' environment variable data: '%s'. Error: %s", debugFlagEnvName, debugFlagRaw, err.Error())
|
||||||
|
|
||||||
if options.ErrorsAreCritical {
|
if options.ErrorsAreCritical {
|
||||||
|
// nolint
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -90,8 +90,8 @@ type testStruct1 struct {
|
|||||||
TestNest testDatas
|
TestNest testDatas
|
||||||
TestNestInterfacePointer interface{}
|
TestNestInterfacePointer interface{}
|
||||||
TestNestInterface interface{}
|
TestNestInterface interface{}
|
||||||
testUnexported string
|
// testUnexported string
|
||||||
testUnexportedNest *testDatas
|
// testUnexportedNest *testDatas
|
||||||
}
|
}
|
||||||
|
|
||||||
type testStructWithMap struct {
|
type testStructWithMap struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user