Linting, CI, some small logic fixes.

This commit is contained in:
2020-11-21 21:25:16 +05:00
parent 94234816c5
commit 3d8d3e478c
11 changed files with 252 additions and 91 deletions

5
sec.go
View File

@@ -1,7 +1,6 @@
package sec
import (
// stdlib
"errors"
"log"
"os"
@@ -38,9 +37,11 @@ func Parse(structure interface{}, config *Options) error {
debugFlagRaw, found := os.LookupEnv(debugFlagEnvName)
if found {
var err error
debug, err = strconv.ParseBool(debugFlagRaw)
if err != nil {
log.Println("Invalid '" + debugFlagEnvName + "' environment variable data: '" + debugFlagRaw + "'. Error: " + err.Error())
log.Printf("Invalid '%s' environment variable data: '%s'. Error: %s", debugFlagEnvName, debugFlagRaw, err.Error())
if options.ErrorsAreCritical {
return err
}