Remove fatal from pkg

* Functions in pkg should return errors
 * If aborting is desired, that behavior should be left to the consumer
This commit is contained in:
Eric Meyer
2017-12-04 09:54:39 -06:00
parent 7a11d3c50f
commit 655d1b1d6f
8 changed files with 31 additions and 26 deletions
+3 -3
View File
@@ -1,7 +1,6 @@
package config
import (
"log"
"os"
"fmt"
@@ -50,8 +49,9 @@ func parseConfigFile(filePath string) (*Config, error) {
if err != nil {
return nil, err
} else {
if _, err := toml.DecodeFile(filePath, &cfg); err != nil {
log.Fatal(err)
_, err := toml.DecodeFile(filePath, &cfg)
if err != nil {
return nil, err
}
return &cfg, err
}