diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-08-27 01:32:30 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-08-27 01:32:30 +0100 |
commit | 921818bca208f0c70e85ec670074cb3905cbbc82 (patch) | |
tree | 4aa67ad2bb2083bd486db3f99680d6d08a2c36b3 /vendor/github.com/spf13/viper/util.go | |
parent | 7f1c9358805302344a89c1fed4eab1342931b061 (diff) |
Update dependencies
Diffstat (limited to 'vendor/github.com/spf13/viper/util.go')
-rw-r--r-- | vendor/github.com/spf13/viper/util.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vendor/github.com/spf13/viper/util.go b/vendor/github.com/spf13/viper/util.go index 0cc4553..fe6cb45 100644 --- a/vendor/github.com/spf13/viper/util.go +++ b/vendor/github.com/spf13/viper/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" @@ -77,7 +77,7 @@ func absPathify(inPath string) string { // Check if File / Directory Exists func exists(path string) (bool, error) { - _, err := os.Stat(path) + _, err := v.fs.Stat(path) if err == nil { return true, nil } @@ -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 { + tree, err := toml.LoadReader(buf) + if err != nil { return ConfigParseError{err} } + tmap := tree.ToMap() + for k, v := range tmap { + c[k] = v + } case "properties", "props", "prop": var p *properties.Properties |