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
If same field exists both in parent and embedded struct and url.Values has value only for parent then decoder incorrect set embedded field to same value.
typeEmbedstruct {
Astring
}
vardatastruct {
AstringEmbed
}
form.NewDecoder().Decode(&data, url.Values{
"A": {"one"},
})
fmt.Println(data.A, data.Embed.A)
// Output: one one
If we will add "Embed.A":{"two"} or keep only this one and remove "A": {"one"} then it'll work as expected.