mirror of
https://github.com/golang/go
synced 2024-11-26 01:07:57 -07:00
encoding/binary: use list format in docstrings
This looks way better than the code formatting. Similar to CL 597656. Change-Id: If404c952ece384aea096f2394bd475a601627a79 Reviewed-on: https://go-review.googlesource.com/c/go/+/597657 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
451a284d80
commit
0dae393a26
@ -62,10 +62,9 @@ func PutUvarint(buf []byte, x uint64) int {
|
|||||||
// Uvarint decodes a uint64 from buf and returns that value and the
|
// Uvarint decodes a uint64 from buf and returns that value and the
|
||||||
// number of bytes read (> 0). If an error occurred, the value is 0
|
// number of bytes read (> 0). If an error occurred, the value is 0
|
||||||
// and the number of bytes n is <= 0 meaning:
|
// and the number of bytes n is <= 0 meaning:
|
||||||
//
|
// - n == 0: buf too small;
|
||||||
// n == 0: buf too small
|
// - n < 0: value larger than 64 bits (overflow) and -n is the number of
|
||||||
// n < 0: value larger than 64 bits (overflow)
|
// bytes read.
|
||||||
// and -n is the number of bytes read
|
|
||||||
func Uvarint(buf []byte) (uint64, int) {
|
func Uvarint(buf []byte) (uint64, int) {
|
||||||
var x uint64
|
var x uint64
|
||||||
var s uint
|
var s uint
|
||||||
@ -110,10 +109,9 @@ func PutVarint(buf []byte, x int64) int {
|
|||||||
// Varint decodes an int64 from buf and returns that value and the
|
// Varint decodes an int64 from buf and returns that value and the
|
||||||
// number of bytes read (> 0). If an error occurred, the value is 0
|
// number of bytes read (> 0). If an error occurred, the value is 0
|
||||||
// and the number of bytes n is <= 0 with the following meaning:
|
// and the number of bytes n is <= 0 with the following meaning:
|
||||||
//
|
// - n == 0: buf too small;
|
||||||
// n == 0: buf too small
|
// - n < 0: value larger than 64 bits (overflow)
|
||||||
// n < 0: value larger than 64 bits (overflow)
|
// and -n is the number of bytes read.
|
||||||
// and -n is the number of bytes read
|
|
||||||
func Varint(buf []byte) (int64, int) {
|
func Varint(buf []byte) (int64, int) {
|
||||||
ux, n := Uvarint(buf) // ok to continue in presence of error
|
ux, n := Uvarint(buf) // ok to continue in presence of error
|
||||||
x := int64(ux >> 1)
|
x := int64(ux >> 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user