Closed marselester closed 11 months ago
Stack overflow occurs when a struct embeds a non-exported struct.
package main import ( toml "github.com/pelletier/go-toml/v2" ) func main() { b := []byte(` fizz = "..." blah.a = "..."`) var cfg config if err := toml.Unmarshal(b, &cfg); err != nil { panic(err) } } type config struct { Fizz string `toml:"fizz"` blah `toml:"blah"` } type blah struct { A string `toml:"a"` }
I would expect Unmarshal to return an error.
Unmarshal
Versions
Thank you for the bug report!
This should have been fixed at the tip of the v2 branch. Feel free to re-open if anything doesn't work as expected!
Pushed go-toml v2.1.1 with this fix.
Awesome, thank you!
Stack overflow occurs when a struct embeds a non-exported struct.
I would expect
Unmarshal
to return an error.Versions