Fixing Config read

This commit is contained in:
Lukas Bachschwell 2018-11-18 09:33:54 +00:00
parent aeacaee144
commit e9d3dcb6c9
1 changed files with 7 additions and 2 deletions

View File

@ -27,9 +27,14 @@ var dbs map[string]*sql.DB
// InitCompanyDBService Init companydb service and open system db connection
func InitCompanyDBService() {
tomlData, _ := ioutil.ReadFile("conf/dbConfig.toml")
tomlData, err := ioutil.ReadFile("conf/dbconfig.toml")
if err != nil {
// handle Read error
panic(err.Error())
os.Exit(1)
}
if _, err := toml.Decode(string(tomlData), &Conf); err != nil {
// handle error
// handle Parse error
panic(err.Error())
os.Exit(1)
}