Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
heiyeluren authored Feb 24, 2022
1 parent 3baf91d commit 1ace23f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tmconfig/tmconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"strings"
)

// 存储全局配置信息
var G_TMCONFIG map[string]map[string]string

// 内指定配置文件路径
Expand Down Expand Up @@ -79,12 +80,15 @@ func ParseConf() (err error) {
}

//默认的配置文件路径
path := "../conf/conf.ini"
path := "conf/conf.ini"
return parseFile(path)
}

// 获取整个section的配置
func GetSection(section string) map[string]string {
func GetSection(section string) (map[string]string, err error) {
if len(G_TMCONFIG) == 0 {
return nil
}
if cfm, ok := G_TMCONFIG[section]; ok {
return cfm
}
Expand Down

0 comments on commit 1ace23f

Please sign in to comment.