Fix backward incompatibility for Set* methods (#213)

Patch #185 introduced a backward incompatibility by changing the arguments
of the `Set*` methods on `Tree`.

This change restores the arguments to what they previous were, and
introduces `SetWithComment` and `SetPathWithComment` to perform the same
action.
This commit is contained in:
Thomas Pelletier
2018-01-18 14:54:55 -08:00
committed by GitHub
parent 778c285afa
commit acdc450948
4 changed files with 21 additions and 9 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ func assertTree(t *testing.T, tree *Tree, err error, ref map[string]interface{})
func TestCreateSubTree(t *testing.T) {
tree := newTree()
tree.createSubTree([]string{"a", "b", "c"}, Position{})
tree.Set("a.b.c", "", false, 42)
tree.Set("a.b.c", 42)
if tree.Get("a.b.c") != 42 {
t.Fail()
}