(b *buffer)
| 386 | } |
| 387 | |
| 388 | func (d *Decoder) readCountedString(b *buffer) (string, error) { |
| 389 | n, err := readUvarintAsInt(b) |
| 390 | if err != nil { |
| 391 | return "", errBadFormat |
| 392 | } |
| 393 | name, err := b.read(n) |
| 394 | if err != nil { |
| 395 | return "", errBadFormat |
| 396 | } |
| 397 | // pull the name out before the next read which might overwrite the buffer |
| 398 | return string(name), nil |
| 399 | } |
| 400 | |
| 401 | func (d *Decoder) readTypeName(b *buffer) error { |
| 402 | name, err := d.readCountedString(b) |
no test coverage detected