Skip to content

Commit 2ad374a

Browse files
json: remove unnecessary bespoke pointer types
The codec construction handles these without issue just like any other pointer-to-something.
1 parent 70730b1 commit 2ad374a

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

json/codec.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,6 @@ func constructCodec(t reflect.Type, seen map[reflect.Type]*structType, canAddr b
145145

146146
case rawMessageType:
147147
c = codec{encode: encoder.encodeRawMessage, decode: decoder.decodeRawMessage}
148-
149-
case numberPtrType:
150-
c = constructPointerCodec(numberPtrType, nil)
151-
152-
case durationPtrType:
153-
c = constructPointerCodec(durationPtrType, nil)
154-
155-
case timePtrType:
156-
c = constructPointerCodec(timePtrType, nil)
157-
158-
case rawMessagePtrType:
159-
c = constructPointerCodec(rawMessagePtrType, nil)
160148
}
161149

162150
if c.encode != nil {
@@ -1120,11 +1108,6 @@ var (
11201108
timeType = reflect.TypeOf(time.Time{})
11211109
rawMessageType = reflect.TypeOf(RawMessage(nil))
11221110

1123-
numberPtrType = reflect.PointerTo(numberType)
1124-
durationPtrType = reflect.PointerTo(durationType)
1125-
timePtrType = reflect.PointerTo(timeType)
1126-
rawMessagePtrType = reflect.PointerTo(rawMessageType)
1127-
11281111
sliceInterfaceType = reflect.TypeOf(([]any)(nil))
11291112
sliceStringType = reflect.TypeOf(([]any)(nil))
11301113
mapStringInterfaceType = reflect.TypeOf((map[string]any)(nil))

0 commit comments

Comments
 (0)