(t reflect.Type)
| 763 | } |
| 764 | |
| 765 | func 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 | |
| 777 | type arrayEncoder struct { |
| 778 | elemEnc encoderFunc |
no test coverage detected