feat(env): clean env variable values

- Remove surrounding spaces
- Remove suffix new line characters
This commit is contained in:
Quentin McGaw
2022-05-27 17:22:50 +00:00
parent 7fd45cf17f
commit 364f9de756
18 changed files with 51 additions and 50 deletions

View File

@@ -2,7 +2,6 @@ package env
import (
"fmt"
"os"
"github.com/qdm12/gluetun/internal/configuration/settings"
"github.com/qdm12/govalid/binary"
@@ -18,7 +17,7 @@ func readVersion() (version settings.Version, err error) {
}
func readVersionEnabled() (enabled *bool, err error) {
s := os.Getenv("VERSION_INFORMATION")
s := getCleanedEnv("VERSION_INFORMATION")
if s == "" {
return nil, nil //nolint:nilnil
}