diff options
| author | Russ Cox <rsc@golang.org> | 2019-05-08 18:50:52 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2019-05-09 18:02:19 +0000 |
| commit | c514071988ac08249c8675dfa501ad242c4c0cec (patch) | |
| tree | 995f87ff6a8644c95fc537de163a4a82a8d9c6f3 /src/encoding/gob/encode.go | |
| parent | 50a1d89ab2b193e7583da32be551e6074e1e7f9a (diff) | |
| download | go-c514071988ac08249c8675dfa501ad242c4c0cec.tar.xz | |
encoding/gob: rename encBuffer.WriteByte to writeByte
Renaming the method makes clear, both to readers and to vet,
that this method is not the implementation of io.ByteWriter.
Working toward making the tree vet-safe instead of having
so many exceptions in cmd/vet/all/whitelist.
For #31916.
Change-Id: I5b509eb7f0118d5f2d3c6e352ff2849cd5a3071e
Reviewed-on: https://go-review.googlesource.com/c/go/+/176110
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/encoding/gob/encode.go')
| -rw-r--r-- | src/encoding/gob/encode.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/encoding/gob/encode.go b/src/encoding/gob/encode.go index 5371e7245f..8f8f170c16 100644 --- a/src/encoding/gob/encode.go +++ b/src/encoding/gob/encode.go @@ -47,7 +47,7 @@ var encBufferPool = sync.Pool{ }, } -func (e *encBuffer) WriteByte(c byte) { +func (e *encBuffer) writeByte(c byte) { e.data = append(e.data, c) } @@ -106,7 +106,7 @@ func (enc *Encoder) freeEncoderState(e *encoderState) { // encodeUint writes an encoded unsigned integer to state.b. func (state *encoderState) encodeUint(x uint64) { if x <= 0x7F { - state.b.WriteByte(uint8(x)) + state.b.writeByte(uint8(x)) return } |
