diff options
Diffstat (limited to 'svc/init_test.go')
-rw-r--r-- | svc/init_test.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/svc/init_test.go b/svc/init_test.go index 009b4e0..9c99a3b 100644 --- a/svc/init_test.go +++ b/svc/init_test.go @@ -6,6 +6,7 @@ import ( "log" "os" "strings" + "sync" "time" "github.com/fsnotify/fsnotify" @@ -15,13 +16,14 @@ import ( var testport = fmt.Sprintf(":%v", confObj.Port) var hasInit = false +var initTestOnce sync.Once + func initTestConf() { - if !hasInit { + initTestOnce.Do(func() { testConfig() tmpls = testTemplates() logToNull() - hasInit = true - } + }) } func logToNull() { |