aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/viper/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/spf13/viper/util.go')
-rw-r--r--vendor/github.com/spf13/viper/util.go11
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