-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
40 lines (34 loc) · 790 Bytes
/
config.go
File metadata and controls
40 lines (34 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package goconf
import (
"github.com/astaxie/beego/config"
"log"
)
var (
AppConf config.Configer
confFileLocations = []string{
"conf/development.conf",
"development.conf",
"../conf/development.conf",
"../../conf/development.conf",
"../../../conf/development.conf",
"conf/production.conf",
"production.conf",
"../conf/production.conf",
"../../conf/production.conf",
"../../../conf/production.conf",
}
)
func init() {
var err error
for _, file := range confFileLocations {
AppConf, err = config.NewConfig("ini", file)
// if there is no error then we found it
if err == nil {
return
}
}
if err != nil {
log.Printf("Could not find any config file in the following paths: %+v\n", confFileLocations)
}
AppConf = config.NewFakeConfig()
}