Skip to content

Commit 83b5f06

Browse files
Stefan Nilssonrsc
Stefan Nilsson
authored andcommitted
binary: remove unnecessary dummy type.
R=rsc CC=golang-dev https://golang.org/cl/5698052
1 parent 999c77d commit 83b5f06

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/pkg/encoding/binary/binary.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@ type ByteOrder interface {
2929
String() string
3030
}
3131

32-
// This is byte instead of struct{} so that it can be compared,
33-
// allowing, e.g., order == binary.LittleEndian.
34-
type unused byte
35-
3632
// LittleEndian is the little-endian implementation of ByteOrder.
3733
var LittleEndian littleEndian
3834

3935
// BigEndian is the big-endian implementation of ByteOrder.
4036
var BigEndian bigEndian
4137

42-
type littleEndian unused
38+
type littleEndian struct{}
4339

4440
func (littleEndian) Uint16(b []byte) uint16 { return uint16(b[0]) | uint16(b[1])<<8 }
4541

@@ -79,7 +75,7 @@ func (littleEndian) String() string { return "LittleEndian" }
7975

8076
func (littleEndian) GoString() string { return "binary.LittleEndian" }
8177

82-
type bigEndian unused
78+
type bigEndian struct{}
8379

8480
func (bigEndian) Uint16(b []byte) uint16 { return uint16(b[1]) | uint16(b[0])<<8 }
8581

0 commit comments

Comments
 (0)