MCPcopy Create free account
hub / github.com/blues/note / newSliceEncoder

Function newSliceEncoder

jsonxt/encode.go:765–775  ·  view source on GitHub ↗
(t reflect.Type)

Source from the content-addressed store, hash-verified

763}
764
765func newSliceEncoder(t reflect.Type) encoderFunc {
766 // Byte slices get special treatment; arrays don't.
767 if t.Elem().Kind() == reflect.Uint8 {
768 p := reflect.PointerTo(t.Elem())
769 if !p.Implements(marshalerType) && !p.Implements(textMarshalerType) {
770 return encodeByteSlice
771 }
772 }
773 enc := sliceEncoder{newArrayEncoder(t)}
774 return enc.encode
775}
776
777type arrayEncoder struct {
778 elemEnc encoderFunc

Callers 1

newTypeEncoderFunction · 0.85

Calls 1

newArrayEncoderFunction · 0.85

Tested by

no test coverage detected