Skip to content

Commit

Permalink
周报工具
Browse files Browse the repository at this point in the history
  • Loading branch information
jqiris committed May 15, 2021
1 parent 2c186b5 commit fd789dc
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@ package conf
import (
"encoding/json"
"io/ioutil"

"github.com/sirupsen/logrus"
)

var (
config = new(Config)
logger = logrus.WithField("package", "conf")
)

func InitConf(filename string) error {
content, err := ioutil.ReadFile(filename)
if err != nil {
logger.Errorf("read file: %v error:%v", filename, err)
return err
}
err = json.Unmarshal(content, config)
if err != nil {
logger.Errorf("decode json error: %v", err)
return err
}
return nil
Expand Down

0 comments on commit fd789dc

Please sign in to comment.