readListPackEntryAsString return a string representation of entry It means if the entry is a integer, then format it as string
(buf []byte, cursor *int)
| 183 | // readListPackEntryAsString return a string representation of entry |
| 184 | // It means if the entry is a integer, then format it as string |
| 185 | func (dec *Decoder) readListPackEntryAsString(buf []byte, cursor *int) ([]byte, error) { |
| 186 | str, intval, _, err := dec.readListPackEntry(buf, cursor) |
| 187 | if err != nil { |
| 188 | return nil, fmt.Errorf("read from failed: %v", err) |
| 189 | } |
| 190 | if str != nil { |
| 191 | return str, nil |
| 192 | } |
| 193 | str = []byte(strconv.FormatInt(intval, 10)) |
| 194 | return str, nil |
| 195 | } |
| 196 | |
| 197 | func (dec *Decoder) readListPackEntryAsInt(buf []byte, cursor *int) (int64, error) { |
| 198 | str, intval, _, err := dec.readListPackEntry(buf, cursor) |
no test coverage detected