Fixing Config read
This commit is contained in:
parent
aeacaee144
commit
e9d3dcb6c9
@ -27,9 +27,14 @@ var dbs map[string]*sql.DB
|
|||||||
// InitCompanyDBService Init companydb service and open system db connection
|
// InitCompanyDBService Init companydb service and open system db connection
|
||||||
func InitCompanyDBService() {
|
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 {
|
if _, err := toml.Decode(string(tomlData), &Conf); err != nil {
|
||||||
// handle error
|
// handle Parse error
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user