[Comment] Correct the comment on Decbuf.UvarintBytes

The value is valid when returned, but can become invalid later.

Return to previous wording.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2024-08-30 09:38:38 +01:00
parent a77f5007f9
commit 0a4f130b39

View file

@ -201,8 +201,9 @@ func (d *Decbuf) UvarintStr() string {
return string(d.UvarintBytes())
}
// UvarintBytes returns invalid values if the byte slice goes away.
// Compared to UvarintStr, it avoid allocations.
// UvarintBytes returns a pointer to internal data;
// the return value becomes invalid if the byte slice goes away.
// Compared to UvarintStr, this avoids allocations.
func (d *Decbuf) UvarintBytes() []byte {
l := d.Uvarint64()
if d.E != nil {