(l int)
| 52 | } |
| 53 | |
| 54 | func (e *Encoder) encodeStringLen(l int) error { |
| 55 | if l < 32 { |
| 56 | return e.writeCode(msgpcode.FixedStrLow | byte(l)) |
| 57 | } |
| 58 | if l < 256 { |
| 59 | return e.write1(msgpcode.Str8, uint8(l)) |
| 60 | } |
| 61 | if l <= math.MaxUint16 { |
| 62 | return e.write2(msgpcode.Str16, uint16(l)) |
| 63 | } |
| 64 | return e.write4(msgpcode.Str32, uint32(l)) |
| 65 | } |
| 66 | |
| 67 | func (e *Encoder) EncodeString(v string) error { |
| 68 | if intern := e.flags&useInternedStringsFlag != 0; intern || len(e.dict) > 0 { |
no test coverage detected