Config package for environment overloaded by flag configuration

This commit is contained in:
Bel LaPointe
2018-10-07 23:05:35 -06:00
parent 74039efb66
commit f7ffe6c829
2 changed files with 46 additions and 0 deletions

16
config/config_test.go Normal file
View File

@@ -0,0 +1,16 @@
package config
import (
"os"
"testing"
)
func Test_Config(t *testing.T) {
was := os.Getenv("DBPATH")
defer os.Setenv("DBPATH", was)
os.Setenv("DBPATH", "filler")
c := New()
if c.DBPath != "filler" {
t.Errorf("DBPATH not overridden by env")
}
}