aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/encoding/binary/varint.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/encoding/binary/varint.go')
-rw-r--r--src/pkg/encoding/binary/varint.go17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/pkg/encoding/binary/varint.go b/src/pkg/encoding/binary/varint.go
index d4872eea2c..6566ab0600 100644
--- a/src/pkg/encoding/binary/varint.go
+++ b/src/pkg/encoding/binary/varint.go
@@ -98,14 +98,6 @@ func Varint(buf []byte) (int64, int) {
return x, n
}
-// WriteUvarint encodes x and writes the result to w.
-func WriteUvarint(w io.Writer, x uint64) error {
- var buf [MaxVarintLen64]byte
- n := PutUvarint(buf[:], x)
- _, err := w.Write(buf[0:n])
- return err
-}
-
var overflow = errors.New("binary: varint overflows a 64-bit integer")
// ReadUvarint reads an encoded unsigned integer from r and returns it as a uint64.
@@ -129,15 +121,6 @@ func ReadUvarint(r io.ByteReader) (uint64, error) {
panic("unreachable")
}
-// WriteVarint encodes x and writes the result to w.
-func WriteVarint(w io.Writer, x int64) error {
- ux := uint64(x) << 1
- if x < 0 {
- ux = ^ux
- }
- return WriteUvarint(w, ux)
-}
-
// ReadVarint reads an encoded unsigned integer from r and returns it as a uint64.
func ReadVarint(r io.ByteReader) (int64, error) {
ux, err := ReadUvarint(r) // ok to continue in presence of error