From 3ad6393f8676b1b408673bf40b8a876f29561eef Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Sun, 12 Feb 2023 15:37:00 +0200 Subject: src: rename unexported errors by adding prefix err By convention, use `err` as prefix for variables of type `error`. Change-Id: I9401d5d47e994a27be245b2c8b1edd55cdd52db1 Reviewed-on: https://go-review.googlesource.com/c/go/+/467536 Auto-Submit: Ian Lance Taylor Reviewed-by: Robert Griesemer TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor --- src/encoding/binary/varint.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/encoding/binary/varint.go') diff --git a/src/encoding/binary/varint.go b/src/encoding/binary/varint.go index 18e1ff1511..7b14fb2b63 100644 --- a/src/encoding/binary/varint.go +++ b/src/encoding/binary/varint.go @@ -123,7 +123,7 @@ func Varint(buf []byte) (int64, int) { return x, n } -var overflow = errors.New("binary: varint overflows a 64-bit integer") +var errOverflow = errors.New("binary: varint overflows a 64-bit integer") // ReadUvarint reads an encoded unsigned integer from r and returns it as a uint64. // The error is EOF only if no bytes were read. @@ -142,14 +142,14 @@ func ReadUvarint(r io.ByteReader) (uint64, error) { } if b < 0x80 { if i == MaxVarintLen64-1 && b > 1 { - return x, overflow + return x, errOverflow } return x | uint64(b)<