You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this when having the problem i reported in #107
Using the following:
package main
import (
"fmt""strings"
toml "github.com/pelletier/go-toml"
)
funcmain(){
varm1=map[string]interface{}{
"foo": 1,
"bar": "baz",
"qux": map[string]interface{}{
"foo": 1,
"bar": "baz",
},
"foobar": true,
}
// generate a tree from m1, then convert to a stringtree:=toml.TreeFromMap(m1)
r:=strings.NewReader(tree.ToString())
// load in the generated toml stringtoml, err:=toml.LoadReader(r)
iferr!=nil {
panic(err)
}
// convert to a maptmap:=toml.ToMap()
// debugfmt.Print(tree.ToString())
fmt.Println(tmap)
}
Most of the time everything would work correctly, but occasionally i would get an error:
panic: (6, 1): The following key was defined twice: qux.foo
goroutine 1 [running]:
panic(0xe4160, 0xc42000af20)
/usr/local/Cellar/go/1.7.3/libexec/src/runtime/panic.go:500 +0x1a1
main.main()
Again, i'm not sure if it's down to how i am using the library or if theres something going wrong somewhere else. Any ideas?
The text was updated successfully, but these errors were encountered:
Hey,
I came across this when having the problem i reported in #107
Using the following:
Most of the time everything would work correctly, but occasionally i would get an error:
Again, i'm not sure if it's down to how i am using the library or if theres something going wrong somewhere else. Any ideas?
The text was updated successfully, but these errors were encountered: