Fix #153
This commit is contained in:
parent
18b6be23c1
commit
eac57d05ba
|
@ -265,12 +265,12 @@ func Save() bool {
|
|||
}
|
||||
|
||||
// Load loads the configurations from wide.json.
|
||||
func Load() {
|
||||
bytes, _ := ioutil.ReadFile("conf/wide.json")
|
||||
func Load(confPath string) {
|
||||
bytes, _ := ioutil.ReadFile(confPath)
|
||||
|
||||
err := json.Unmarshal(bytes, &Wide)
|
||||
if err != nil {
|
||||
glog.Error(err)
|
||||
glog.Error("Parses wide.json error: ", err)
|
||||
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
|
5
main.go
5
main.go
|
@ -40,6 +40,8 @@ import (
|
|||
// The only one init function in Wide.
|
||||
func init() {
|
||||
// TODO: args
|
||||
confPath := flag.String("conf", "conf/wide.json", "path of wide.json")
|
||||
|
||||
flag.Set("logtostderr", "true")
|
||||
flag.Set("v", "3")
|
||||
flag.Parse()
|
||||
|
@ -48,7 +50,8 @@ func init() {
|
|||
|
||||
event.Load()
|
||||
|
||||
conf.Load()
|
||||
conf.Load(*confPath)
|
||||
|
||||
conf.FixedTimeCheckEnv()
|
||||
conf.FixedTimeSave()
|
||||
|
||||
|
|
Loading…
Reference in New Issue