diff options
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. |