Open
Description
It seems that map
types are not supported. E.g. map[interface{}]interface{}
or map[string]string
. Is this the expected behaviour?
package main
import (
"fmt"
"github.com/go-playground/form"
"net/url"
"reflect"
)
func main() {
dec := form.NewDecoder()
req := url.Values{"a": []string{"a"}, "b": []string{"b"}, "c": []string{"1"}}
v := map[interface{}]interface{}{
"a": "",
"b": "",
"c": 0,
}
expected := map[interface{}]interface{}{
"a": "a",
"b": "b",
"c": 1,
}
if err := dec.Decode(&v, req); err != nil {
panic(err)
}
if !reflect.DeepEqual(v, expected) {
fmt.Printf("expected\n %#v\n received\n %#v", expected, v)
}
}
Metadata
Metadata
Assignees
Labels
No labels