Repository: incubator-mynewt-newt Updated Branches: refs/heads/develop 23a6f5ffa -> 4ae9684f2
Viper: Remove hashicorp and toml dependencies. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/1ef31a09 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/1ef31a09 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/1ef31a09 Branch: refs/heads/develop Commit: 1ef31a09a670694c02ddf61d209522651c52ec33 Parents: 23a6f5f Author: Christopher Collins <ccoll...@apache.org> Authored: Wed Mar 16 13:39:27 2016 -0700 Committer: Christopher Collins <ccoll...@apache.org> Committed: Wed Mar 16 13:39:27 2016 -0700 ---------------------------------------------------------------------- viper/util.go | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/1ef31a09/viper/util.go ---------------------------------------------------------------------- diff --git a/viper/util.go b/viper/util.go index 6598b17..0f52fc1 100644 --- a/viper/util.go +++ b/viper/util.go @@ -25,12 +25,9 @@ import ( "strings" "unicode" - "mynewt.apache.org/newt/yaml" - "github.com/BurntSushi/toml" - "github.com/hashicorp/hcl" - "github.com/magiconair/properties" "github.com/spf13/cast" jww "github.com/spf13/jwalterweatherman" + "mynewt.apache.org/newt/yaml" ) // Denotes failing to parse configuration file. @@ -148,31 +145,6 @@ func unmarshallConfigReader(in io.Reader, c map[string]interface{}, configType s if err := json.Unmarshal(buf.Bytes(), &c); err != nil { return ConfigParseError{err} } - - case "hcl": - obj, err := hcl.Parse(string(buf.Bytes())) - if err != nil { - return ConfigParseError{err} - } - if err = hcl.DecodeObject(&c, obj); err != nil { - return ConfigParseError{err} - } - - case "toml": - if _, err := toml.Decode(buf.String(), &c); err != nil { - return ConfigParseError{err} - } - - case "properties", "props", "prop": - var p *properties.Properties - var err error - if p, err = properties.Load(buf.Bytes(), properties.UTF8); err != nil { - return ConfigParseError{err} - } - for _, key := range p.Keys() { - value, _ := p.Get(key) - c[key] = value - } } insensitiviseMap(c)