summary refs log tree commit diff stats
path: root/svc/init_test.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-05 15:36:23 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-05 15:36:23 -0400
commitfd43c61bd128ad77b22db0537a9a4eb58490b0b5 (patch)
tree4c5fa7b33fadbf7c3e14e69b7d68ce280bc3810a /svc/init_test.go
parent4658fe82be3e9d95e93fa5c7c7ca64a15cf2f1a1 (diff)
downloadgetwtxt-fd43c61bd128ad77b22db0537a9a4eb58490b0b5.tar.gz
moved bulk of code to its own package to clean up source tree
Diffstat (limited to 'svc/init_test.go')
-rw-r--r--svc/init_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/svc/init_test.go b/svc/init_test.go
new file mode 100644
index 0000000..58f39f9
--- /dev/null
+++ b/svc/init_test.go
@@ -0,0 +1,27 @@
+package svc // import github.com/getwtxt/getwtxt/svc
+
+import (
+	"fmt"
+	"log"
+	"os"
+)
+
+var testport = fmt.Sprintf(":%v", confObj.Port)
+var hasInit = false
+
+func initTestConf() {
+	if !hasInit {
+		initConfig()
+		tmpls = initTemplates()
+		logToNull()
+		hasInit = true
+	}
+}
+
+func logToNull() {
+	hush, err := os.Open("/dev/null")
+	if err != nil {
+		log.Printf("%v\n", err)
+	}
+	log.SetOutput(hush)
+}