Exemple #1
0
func GetConfig(filename string, name string) string {
	cfgpath := dogo.Register.Get("cfg_path")
	config, err := dogo.NewConfig(fmt.Sprintf("%s/%s.ini", cfgpath, filename))
	if err != nil {
		return ""
	}
	str, err := config.String(Env(), name)
	if err != nil {
		return ""
	}
	return str
}
Exemple #2
0
func Env() string {
	inipath := fmt.Sprintf("%s", dogo.Register.Get("app_ini"))
	config, err := dogo.NewConfig(inipath)
	if err != nil {
		loger.Print(err.Error())
		return env
	}
	env, err := config.String("base", "environ")
	if err != nil {
		loger.Print(err.Error())
		return env
	}
	return env
}