We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Unmarshaling to a field of a table in an array of tables causes a panic.
To Reproduce https://go.dev/play/p/l2KDjY4lX-3
m := struct { A []struct { B struct{} } }{} fmt.Println(toml.Unmarshal([]byte(`[[A.B]]`), &m))
Expected behavior If this is invalid, I expect an error rather than a panic.
Versions
The text was updated successfully, but these errors were encountered:
Thank you for the bug report! I'll take a look when I have time, but feel free to send a pull request in the meantime!
Sorry, something went wrong.
add TestUnmarshalArrayOfTables and placeholder error; towards pelleti…
cedfd51
…er#839
@pelletier I started a draft that highlights the problematic area (#840). Is returning an error the correct thing to do here?
You're correct: this should be an error, because the array of tables is on A.B, and B is a struct, not a slice.
A.B
B
No branches or pull requests
Describe the bug
Unmarshaling to a field of a table in an array of tables causes a panic.
To Reproduce
https://go.dev/play/p/l2KDjY4lX-3
Expected behavior
If this is invalid, I expect an error rather than a panic.
Versions
The text was updated successfully, but these errors were encountered: