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
Describe the bug
For nested struct,if there are attributes with same name, parse result is not expected.
To Reproduce
type Server struct {
Name string `toml:"name" default:"noname"`
Inter2 Inter2 `toml:"inter2"`
}
type Inter2 struct {
Name string
Age int
InterStruct2 InterStruct2
}
type InterStruct2 struct {
Test string
Name string
Age int
}
var server Server
err := toml.Unmarshal([]byte(`name = "123"
[inter2]
name = "inter2"
age = 222`), &server)
@jinleiw Thank you for your bug report! Just merged @AllenX2018's patch, which should have fixed the problem. If you are still experiencing the issue with the latest master code, feel free to reopen this issue!
Describe the bug
For nested struct,if there are attributes with same name, parse result is not expected.
To Reproduce
Expected behavior
Expected value of server:
but got:
Versions
The text was updated successfully, but these errors were encountered: