(b []byte, p unsafe.Pointer, flags flags)
| 22 | } |
| 23 | |
| 24 | func encodeString(b []byte, p unsafe.Pointer, flags flags) (int, error) { |
| 25 | if p != nil { |
| 26 | if v := *(*string)(p); v != "" || flags.has(wantzero) { |
| 27 | n, err := encodeVarint(b, uint64(len(v))) |
| 28 | if err != nil { |
| 29 | return n, err |
| 30 | } |
| 31 | c := copy(b[n:], v) |
| 32 | n += c |
| 33 | if c < len(v) { |
| 34 | err = io.ErrShortBuffer |
| 35 | } |
| 36 | return n, err |
| 37 | } |
| 38 | } |
| 39 | return 0, nil |
| 40 | } |
| 41 | |
| 42 | func decodeString(b []byte, p unsafe.Pointer, _ flags) (int, error) { |
| 43 | v, n, err := decodeVarlen(b) |
nothing calls this directly
no test coverage detected
searching dependent graphs…