diff options
| author | Stefan Nilsson <snilsson@nada.kth.se> | 2012-02-23 15:29:17 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2012-02-23 15:29:17 -0500 |
| commit | 83b5f067e88589b4eb5794df5f3ba28b72bce6f1 (patch) | |
| tree | 772b2c8b0638786b57ddeb5019a5d088e2745c9d /src/pkg/encoding/binary | |
| parent | 999c77d78a7f179ec1ef13b4ab6b07853f21deb2 (diff) | |
| download | go-83b5f067e88589b4eb5794df5f3ba28b72bce6f1.tar.xz | |
binary: remove unnecessary dummy type.
R=rsc
CC=golang-dev
https://golang.org/cl/5698052
Diffstat (limited to 'src/pkg/encoding/binary')
| -rw-r--r-- | src/pkg/encoding/binary/binary.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/pkg/encoding/binary/binary.go b/src/pkg/encoding/binary/binary.go index b26b1bb2c9..02f090d53f 100644 --- a/src/pkg/encoding/binary/binary.go +++ b/src/pkg/encoding/binary/binary.go @@ -29,17 +29,13 @@ type ByteOrder interface { String() string } -// This is byte instead of struct{} so that it can be compared, -// allowing, e.g., order == binary.LittleEndian. -type unused byte - // LittleEndian is the little-endian implementation of ByteOrder. var LittleEndian littleEndian // BigEndian is the big-endian implementation of ByteOrder. var BigEndian bigEndian -type littleEndian unused +type littleEndian struct{} func (littleEndian) Uint16(b []byte) uint16 { return uint16(b[0]) | uint16(b[1])<<8 } @@ -79,7 +75,7 @@ func (littleEndian) String() string { return "LittleEndian" } func (littleEndian) GoString() string { return "binary.LittleEndian" } -type bigEndian unused +type bigEndian struct{} func (bigEndian) Uint16(b []byte) uint16 { return uint16(b[1]) | uint16(b[0])<<8 } |
