From 9988dd7738e5fb4bc5814bdd352c4648ea424beb Mon Sep 17 00:00:00 2001 From: Chao Xu Date: Wed, 15 Jun 2016 14:18:38 -0700 Subject: [PATCH] switch to pelletier/go-toml --- util.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util.go b/util.go index 0cc4553..5082c6d 100644 --- a/util.go +++ b/util.go @@ -21,9 +21,9 @@ import ( "strings" "unicode" - "github.com/BurntSushi/toml" "github.com/hashicorp/hcl" "github.com/magiconair/properties" + toml "github.com/pelletier/go-toml" "github.com/spf13/cast" jww "github.com/spf13/jwalterweatherman" "gopkg.in/yaml.v2" @@ -155,9 +155,14 @@ func unmarshallConfigReader(in io.Reader, c map[string]interface{}, configType s } case "toml": - if _, err := toml.Decode(buf.String(), &c); err != nil { + tomlTree, err := toml.Load(buf.String()) + if err != nil { return ConfigParseError{err} } + tomlMap := tomlTree.ToMap() + for key, value := range tomlMap { + c[key] = value + } case "properties", "props", "prop": var p *properties.Properties