Fix plural mistake in Set* docs (#154)
This commit is contained in:
committed by
Thomas Pelletier
parent
76c552dcd7
commit
97253b98df
@@ -171,14 +171,14 @@ func (t *TomlTree) GetDefault(key string, def interface{}) interface{} {
|
||||
|
||||
// Set an element in the tree.
|
||||
// Key is a dot-separated path (e.g. a.b.c).
|
||||
// Creates all necessary intermediates trees, if needed.
|
||||
// Creates all necessary intermediate trees, if needed.
|
||||
func (t *TomlTree) Set(key string, value interface{}) {
|
||||
t.SetPath(strings.Split(key, "."), value)
|
||||
}
|
||||
|
||||
// SetPath sets an element in the tree.
|
||||
// Keys is an array of path elements (e.g. {"a","b","c"}).
|
||||
// Creates all necessary intermediates trees, if needed.
|
||||
// Creates all necessary intermediate trees, if needed.
|
||||
func (t *TomlTree) SetPath(keys []string, value interface{}) {
|
||||
subtree := t
|
||||
for _, intermediateKey := range keys[:len(keys)-1] {
|
||||
|
||||
Reference in New Issue
Block a user