diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2017-04-10 21:18:42 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2017-04-10 21:38:33 +0100 |
commit | 30802e07b2d84fbc213b490d3402707dffe60096 (patch) | |
tree | 934aecb8f3582325dfd1aa6652193adac87d00db /vendor/github.com/pelletier/go-toml/toml.go | |
parent | da7638dc112c4c106e8929601b642d2ca4596cba (diff) |
update dependencies
Diffstat (limited to 'vendor/github.com/pelletier/go-toml/toml.go')
-rw-r--r-- | vendor/github.com/pelletier/go-toml/toml.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vendor/github.com/pelletier/go-toml/toml.go b/vendor/github.com/pelletier/go-toml/toml.go index ad23fe8..1ba56a1 100644 --- a/vendor/github.com/pelletier/go-toml/toml.go +++ b/vendor/github.com/pelletier/go-toml/toml.go @@ -10,13 +10,13 @@ import ( ) type tomlValue struct { - value interface{} + value interface{} // string, int64, uint64, float64, bool, time.Time, [] of any of this list position Position } // TomlTree is the result of the parsing of a TOML file. type TomlTree struct { - values map[string]interface{} + values map[string]interface{} // string -> *tomlValue, *TomlTree, []*TomlTree position Position } @@ -28,10 +28,12 @@ func newTomlTree() *TomlTree { } // TreeFromMap initializes a new TomlTree object using the given map. -func TreeFromMap(m map[string]interface{}) *TomlTree { - return &TomlTree{ - values: m, +func TreeFromMap(m map[string]interface{}) (*TomlTree, error) { + result, err := toTree(m) + if err != nil { + return nil, err } + return result.(*TomlTree), nil } // Has returns a boolean indicating if the given key exists. |