You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
545 B
27 lines
545 B
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/go-ini/ini"
|
|
)
|
|
|
|
var (
|
|
Appconfig = &appConfig{}
|
|
)
|
|
|
|
func LoadSystemConfig(initPath string) (err error) {
|
|
fmt.Println("启动程序,开始加载基础配置......")
|
|
configSetUp, err := ini.Load(initPath)
|
|
if err != nil {
|
|
fmt.Printf("app配置加载失败!\n错误:%v\n", err)
|
|
return
|
|
}
|
|
err = configSetUp.Section("App").MapTo(Appconfig)
|
|
if err != nil {
|
|
fmt.Printf("app配置读取失败!\n错误:%v\n", err)
|
|
return
|
|
}
|
|
fmt.Println("app基础配置全部加载完成!")
|
|
return
|
|
}
|
|
|