Some nolints.

This commit is contained in:
Stanislav Nikitin 2020-11-21 21:35:06 +05:00
parent 9c47d00044
commit 28ada80b4c
No known key found for this signature in database
GPG Key ID: 106900B32F8192EE
3 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,7 @@
package sec
import (
"errors"
"fmt"
"reflect"
"strconv"
)
@ -144,7 +144,9 @@ func fillValue(element *field, data string) error {
element.EnvVar)
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

1
sec.go
View File

@ -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())
if options.ErrorsAreCritical {
// nolint
return err
}
} else {

View File

@ -90,8 +90,8 @@ type testStruct1 struct {
TestNest testDatas
TestNestInterfacePointer interface{}
TestNestInterface interface{}
testUnexported string
testUnexportedNest *testDatas
// testUnexported string
// testUnexportedNest *testDatas
}
type testStructWithMap struct {