readName reads a name (tag or attribute) to the buffer until a non-name byte is encountered.
()
| 628 | |
| 629 | // readName reads a name (tag or attribute) to the buffer until a non-name byte is encountered. |
| 630 | func (d *Decoder) readName() bool { |
| 631 | d.buf.Reset() |
| 632 | |
| 633 | if !d.mustReadWhileFn(isNameByte) { |
| 634 | return false |
| 635 | } |
| 636 | |
| 637 | return d.buf.Len() > 0 |
| 638 | } |
| 639 | |
| 640 | func isNameByte(c byte) bool { |
| 641 | // We allow all non-ASCII bytes as names. |
no test coverage detected