diff options
| author | Daniel Martà <mvdan@mvdan.cc> | 2017-11-18 15:53:53 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-11-18 17:07:05 +0000 |
| commit | 962834dd143311f764d331417fc208ce2045c61a (patch) | |
| tree | 4f7c3c9099599327254b5d6be4d989ed358e956c /src/bytes/buffer.go | |
| parent | aad928957184e0d632ef6f7b83d69d3e3c2e0868 (diff) | |
| download | go-962834dd143311f764d331417fc208ce2045c61a.tar.xz | |
bytes: make all readOp constants actually typed
This is a regression introduced in golang.org/cl/28817. That change got
rid of the iota, which meant that the type was no longer applied to all
the constant names.
Re-add the iota starting at -1, simplifying the code and adding the
types once more.
Change-Id: I38bd0e04f8d298196bccd33651e29f5011401a8d
Reviewed-on: https://go-review.googlesource.com/78617
Run-TryBot: Daniel Martà <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/bytes/buffer.go')
| -rw-r--r-- | src/bytes/buffer.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bytes/buffer.go b/src/bytes/buffer.go index a99e64d1e8..83bb1c7eb5 100644 --- a/src/bytes/buffer.go +++ b/src/bytes/buffer.go @@ -31,12 +31,12 @@ type Buffer struct { type readOp int8 const ( - opRead readOp = -1 // Any other read operation. - opInvalid = 0 // Non-read operation. - opReadRune1 = 1 // Read rune of size 1. - opReadRune2 = 2 // Read rune of size 2. - opReadRune3 = 3 // Read rune of size 3. - opReadRune4 = 4 // Read rune of size 4. + opRead readOp = iota - 1 // Any other read operation. + opInvalid // Non-read operation. + opReadRune1 // Read rune of size 1. + opReadRune2 // Read rune of size 2. + opReadRune3 // Read rune of size 3. + opReadRune4 // Read rune of size 4. ) // ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer. |
