示例#1
0
func TestConf(t *testing.T) {
	c := conf.NewConf(CONF_JSON)
	if c.Host != HOST {
		t.Errorf("error: c.Host=%v, expected=%v", c.Host, HOST)
	} else if c.Port != PORT {
		t.Errorf("error: c.Port=%v, expected=%v", c.Port, PORT)
	} else if c.Database != DATABASE {
		t.Errorf("error: c.Host=%v, expected=%v", c.Host, DATABASE)
	}
}
示例#2
0
func init() {
	c = conf.NewConf("./conf.json")
	mode_dic = make(map[string]string)
	mode_dic["false"] = "NULLABLE"
	mode_dic["true"] = "REQUIRED"
}
示例#3
0
func init() {
	CONF = conf.NewConf("../../conf.json")
}