diff options
author | Joop Kiefte <ikojba@gmail.com> | 2019-01-12 22:24:45 +0100 |
---|---|---|
committer | Joop Kiefte <ikojba@gmail.com> | 2019-01-12 22:24:45 +0100 |
commit | 7813670abf4ec55f819e0c26c2300a274672bf08 (patch) | |
tree | 92665b255dd4d4c74c5d32368652448aea1fb25b /rules/toml.go | |
parent | f22108809004ea08f962cc0ad19ef1fa8051bd0c (diff) |
Add fountain writer and toml configuration
Diffstat (limited to 'rules/toml.go')
-rw-r--r-- | rules/toml.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rules/toml.go b/rules/toml.go index 4bb5946..ccc6479 100644 --- a/rules/toml.go +++ b/rules/toml.go @@ -3,6 +3,7 @@ package rules import ( "github.com/BurntSushi/toml" "os" + "log" ) type TOMLConf struct{ @@ -18,11 +19,13 @@ func ReadFile(file string) (TOMLConf, error) { return r, err } -func MustReadFile(file string) TOMLConf { +func GetConf(file string) TOMLConf { c, err := ReadFile(file) if err != nil { - panic(err) + log.Println("Error loading file, loading default configuration: ", err) + c = DefaultConf() } + log.Println("Configuration set") return c } |