diff --git a/config.go b/config.go deleted file mode 100644 index 463d12a..0000000 --- a/config.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "errors" - "github.com/BurntSushi/toml" -) - -func ReadConfig(fname string) (DnsConfig, error) { - var conf DnsConfig - if _, err := toml.DecodeFile(fname, &conf); err != nil { - return DnsConfig{}, errors.New("Malformed configuration file") - } - return conf, nil -} diff --git a/util.go b/util.go index 8fcc4b9..a2fda88 100644 --- a/util.go +++ b/util.go @@ -2,12 +2,22 @@ package main import ( "crypto/rand" + "errors" + "github.com/BurntSushi/toml" "github.com/satori/go.uuid" "math/big" "regexp" "strings" ) +func ReadConfig(fname string) (DnsConfig, error) { + var conf DnsConfig + if _, err := toml.DecodeFile(fname, &conf); err != nil { + return DnsConfig{}, errors.New("Malformed configuration file") + } + return conf, nil +} + func SanitizeString(s string) string { // URL safe base64 alphabet without padding as defined in ACME re, err := regexp.Compile("[^A-Za-z\\-\\_0-9]+")