v1.14.1
FIXED: * `envs/funcs.go:78:3: unknown field IgnoreWhiteSpace in struct literal of type EnvErrNoVal, but does have IgnoreWhitespace` * `envs/funcs_enverrnoval.go:15:8: sb.WasFound undefined (type *strings.Builder has no field or method WasFound)`
This commit is contained in:
@@ -75,7 +75,7 @@ func GetEnvErrNoBlank(key string, ignoreWhitespace bool) (value string, err erro
|
||||
var e *EnvErrNoVal = &EnvErrNoVal{
|
||||
VarName: key,
|
||||
WasRequiredNonEmpty: true,
|
||||
IgnoreWhiteSpace: ignoreWhitespace,
|
||||
IgnoreWhitespace: ignoreWhitespace,
|
||||
}
|
||||
|
||||
if value, exists = os.LookupEnv(key); !exists {
|
||||
|
||||
@@ -12,13 +12,13 @@ func (e *EnvErrNoVal) Error() (errStr string) {
|
||||
sb.WriteString("the variable '")
|
||||
sb.WriteString(e.VarName)
|
||||
sb.WriteString("' was ")
|
||||
if sb.WasFound {
|
||||
if e.WasFound {
|
||||
sb.WriteString("found")
|
||||
} else {
|
||||
sb.WriteString("not found")
|
||||
}
|
||||
if e.WasRequiredNonEmpty && e.WasFound {
|
||||
sb.WriteString(" but is empty and was required to be non-empty")
|
||||
sb.WriteString(" but is empty and was required to be non-empty")
|
||||
}
|
||||
|
||||
errStr = sb.String()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package envs
|
||||
|
||||
import (
|
||||
`strconv`
|
||||
`strings`
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
`r00t2.io/sysutils/internal`
|
||||
"r00t2.io/sysutils/internal"
|
||||
)
|
||||
|
||||
// envListToMap splits a []string of env var keypairs to a map.
|
||||
@@ -35,7 +35,7 @@ func nativizeEnvMap(stringMap map[string]string) (envMap map[string]interface{})
|
||||
var pathVar string = internal.GetPathEnvName()
|
||||
var err error
|
||||
|
||||
envMap = make(map[string]interface{}, 0)
|
||||
envMap = make(map[string]interface{})
|
||||
|
||||
for k, v := range stringMap {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user