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
funcTestMapToPtrStruct(t*testing.T) {
s:=struct {
// pointer to structMmap[string]*struct {
IDstring
}
}{}
vals:= url.Values{
"M[key].ID": []string{"M[key].ID"},
}
dec:=formam.NewDecoder(nil)
iferr:=dec.Decode(vals, &s); err!=nil {
t.Fatalf("error when decode %s", err)
}
ifv, ok:=s.M["key"]; !ok {
t.Error("The key \"key\" in M does not exists")
} elseifv.ID!="M[key].ID" {
t.Error("The value in key \"key\" of M is incorrect")
}
}
Expected: no error Actual:error when decode formam: unsupported type; maybe include it the UnmarshalText interface or register it using custom type?
The text was updated successfully, but these errors were encountered:
darigaaz
added a commit
to darigaaz/formam
that referenced
this issue
Jan 30, 2021
Code to reproduce:
Expected: no error
Actual:
error when decode formam: unsupported type; maybe include it the UnmarshalText interface or register it using custom type?
The text was updated successfully, but these errors were encountered: