From 7813670abf4ec55f819e0c26c2300a274672bf08 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Sat, 12 Jan 2019 22:24:45 +0100 Subject: Add fountain writer and toml configuration --- rules/toml.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'rules/toml.go') 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 } -- cgit v1.2.3-70-g09d2