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'm getting an error parsing the [tags] sections in valid toml that looks like this:
# Global tags
[tags]
shipment = "2a"# Create list of tables with subtables
[[fruits.apple]]
type = "red delicious"
[fruits.apple.tags]
PLU = 4555
[[fruits.apple]]
type = "granny smith"
[fruits.apple.tags]
PLU = 4556
If I remove the global [tags] heading, or if I only set [fruits.apple.tags] once, the parsing works.
Below are some scripts for reproducing:
package main
import (
"fmt""github.com/naoina/toml"
)
// Global tags cause failureconstfruits=`# Global tags[tags] shipment = "2a"# Create list of tables with subtables[[fruits.apple]] type = "red delicious" [fruits.apple.tags] PLU = 4555[[fruits.apple]] type = "granny smith" [fruits.apple.tags] PLU = 4556`funcmain() {
_, err:=toml.Parse([]byte(fruits))
iferr!=nil {
fmt.Println(err.Error())
return
}
}
it outputs:
% go run /tmp/config.go
toml: line 15: table `fruits.apple.tags' is in conflict with normal table in line 10
but if I take out the global [tags] table, it works:
package main
import (
"fmt""github.com/naoina/toml"
)
// This one works!constfruits=`# Create list of tables with subtables[[fruits.apple]] type = "red delicious" [fruits.apple.tags] PLU = 4555[[fruits.apple]] type = "granny smith" [fruits.apple.tags] PLU = 4556`funcmain() {
_, err:=toml.Parse([]byte(fruits))
iferr!=nil {
fmt.Println(err.Error())
return
}
}
or if I remove one of the [fruits.apple.tags] sections, it also parses OK:
package main
import (
"fmt""github.com/naoina/toml"
)
// This one works!constfruits=`# Create list of tables with subtables[[fruits.apple]] type = "red delicious"[[fruits.apple]] type = "granny smith" [fruits.apple.tags] PLU = 4556`funcmain() {
_, err:=toml.Parse([]byte(fruits))
iferr!=nil {
fmt.Println(err.Error())
return
}
}
The text was updated successfully, but these errors were encountered:
I'm getting an error parsing the [tags] sections in valid toml that looks like this:
If I remove the global
[tags]
heading, or if I only set[fruits.apple.tags]
once, the parsing works.Below are some scripts for reproducing:
it outputs:
but if I take out the global
[tags]
table, it works:or if I remove one of the
[fruits.apple.tags]
sections, it also parses OK:The text was updated successfully, but these errors were encountered: