1
0
mirror of https://github.com/golang/go synced 2024-11-26 08:17:59 -07:00

doc/go1.17: document encoding/binary.Uvarint max read of 10 bytes

Updates #41185
For #44513.
Fixes #46009

Change-Id: I60f4d891b897809765acc0aace037c78e95bb4f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/317929
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Emmanuel T Odeke 2021-05-06 22:15:11 -07:00 committed by Emmanuel Odeke
parent b44c78b8c3
commit af6123a865

View File

@ -303,7 +303,10 @@ Do not send CLs removing the interior tags from such phrases.
<dl id="encoding/binary"><dt><a href="/pkg/encoding/binary/">encoding/binary</a></dt>
<dd>
<p><!-- CL 299531 -->
TODO: <a href="https://golang.org/cl/299531">https://golang.org/cl/299531</a>: limit bytes read by Uvarint to &lt;= 10
<code>binary.Uvarint</code> will stop reading after <code>10 bytes</code> to avoid
wasted computations. If more than <code>10 bytes</code> are needed, the byte count returned is <code>-11</code>.
<br />
Previous Go versions could return larger negative counts when reading incorrectly encoded varints.
</p>
</dd>
</dl><!-- encoding/binary -->