summary refs log blame commit diff stats
path: root/svc/init_test.go
blob: 43992a44a26174e7fa75fcb0b00224348fffd698 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                      






             
                                               
                   

                     





                                       








                                         
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)
}