(typ super.Type)
| 65 | } |
| 66 | |
| 67 | func NewPrimitiveEncoder(typ super.Type) PrimitiveEncoder { |
| 68 | switch id := typ.ID(); { |
| 69 | case super.IsSigned(id): |
| 70 | return NewIntEncoder(typ) |
| 71 | case super.IsUnsigned(id): |
| 72 | return NewUintEncoder(typ) |
| 73 | case super.IsFloat(id): |
| 74 | return NewFloatEncoder(typ) |
| 75 | case id == super.IDBytes || id == super.IDString || id == super.IDType: |
| 76 | return NewBytesEncoder(typ) |
| 77 | default: |
| 78 | return NewScodeEncoder(typ) |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | type NamedEncoder struct { |
| 83 | Encoder |
no test coverage detected