Commit 734e2d97 authored by Mike Jones's avatar Mike Jones 馃尪
Browse files

Remove option to use space between commas - that won't work in an env setting

parent b8a31c37
......@@ -43,10 +43,6 @@ func NewConfig() (*Config, error) {
c.InfluxDB.Username = os.Getenv(influxUserKey)
c.PermittedStatTypes = strings.Split(os.Getenv(permittedStatTypesKey), ",")
for i := range c.PermittedStatTypes {
c.PermittedStatTypes[i] = strings.TrimSpace(c.PermittedStatTypes[i])
}
if !c.Check() {
err = errors.New("Missing environment variables: " + strings.Join([]string{
influxAddrKey,
......
......@@ -38,19 +38,4 @@ func TestNewConfig(t *testing.T) {
t.Fail()
}
})
t.Run("Valid config, two items, space", func(t *testing.T) {
os.Setenv(permittedStatTypesKey, "statx, staty")
c, err := NewConfig()
if err != nil {
t.Fail()
}
if c.PermittedStatTypes[0] != "statx" || c.PermittedStatTypes[1] != "staty" {
t.Logf("Stat types incorrect: '%s', '%s'", c.PermittedStatTypes[0], c.PermittedStatTypes[1])
t.Fail()
}
})
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment