summaryrefslogtreecommitdiff
path: root/vendor/github.com/json-iterator/go/reflect_map.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/json-iterator/go/reflect_map.go')
-rw-r--r--vendor/github.com/json-iterator/go/reflect_map.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go
index 7f66a88b0..547b4421e 100644
--- a/vendor/github.com/json-iterator/go/reflect_map.go
+++ b/vendor/github.com/json-iterator/go/reflect_map.go
@@ -64,14 +64,26 @@ func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
return &numericMapKeyDecoder{decoderOfType(ctx, typ)}
default:
ptrType := reflect2.PtrTo(typ)
- if ptrType.Implements(textMarshalerType) {
+ if ptrType.Implements(unmarshalerType) {
+ return &referenceDecoder{
+ &unmarshalerDecoder{
+ valType: ptrType,
+ },
+ }
+ }
+ if typ.Implements(unmarshalerType) {
+ return &unmarshalerDecoder{
+ valType: typ,
+ }
+ }
+ if ptrType.Implements(textUnmarshalerType) {
return &referenceDecoder{
&textUnmarshalerDecoder{
valType: ptrType,
},
}
}
- if typ.Implements(textMarshalerType) {
+ if typ.Implements(textUnmarshalerType) {
return &textUnmarshalerDecoder{
valType: typ,
}