123456789101112131415
  1. package utils
  2. import (
  3. "github.com/astaxie/beego/config"
  4. )
  5. // GetConfiger 获取配置
  6. func GetConfiger(file string) (config.Configer, error) {
  7. conf, err := config.NewConfig("ini", file)
  8. if err != nil {
  9. return nil, LogError("读取配置文件失败", err.Error())
  10. }
  11. return conf, nil
  12. }