mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
aad9289571
commit
962834dd14
1 changed files with 6 additions and 6 deletions
|
|
@ -31,12 +31,12 @@ type Buffer struct {
|
||||||
type readOp int8
|
type readOp int8
|
||||||
|
|
||||||
const (
|
const (
|
||||||
opRead readOp = -1 // Any other read operation.
|
opRead readOp = iota - 1 // Any other read operation.
|
||||||
opInvalid = 0 // Non-read operation.
|
opInvalid // Non-read operation.
|
||||||
opReadRune1 = 1 // Read rune of size 1.
|
opReadRune1 // Read rune of size 1.
|
||||||
opReadRune2 = 2 // Read rune of size 2.
|
opReadRune2 // Read rune of size 2.
|
||||||
opReadRune3 = 3 // Read rune of size 3.
|
opReadRune3 // Read rune of size 3.
|
||||||
opReadRune4 = 4 // Read rune of size 4.
|
opReadRune4 // Read rune of size 4.
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer.
|
// ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue