Skip to content

Commit 30ad431

Browse files
committed
rename for clarity
1 parent 7a938c5 commit 30ad431

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

encoding.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ package binarydist
44
// It implements binary.ByteOrder using a sign-magnitude format
55
// and little-endian byte order. Only methods Uint64 and String
66
// have been written; the rest panic.
7-
type smle struct{}
7+
type signMagLittleEndian struct{}
88

9-
func (smle) Uint16(b []byte) uint16 { panic("unimplemented") }
9+
func (signMagLittleEndian) Uint16(b []byte) uint16 { panic("unimplemented") }
1010

11-
func (smle) PutUint16(b []byte, v uint16) { panic("unimplemented") }
11+
func (signMagLittleEndian) PutUint16(b []byte, v uint16) { panic("unimplemented") }
1212

13-
func (smle) Uint32(b []byte) uint32 { panic("unimplemented") }
13+
func (signMagLittleEndian) Uint32(b []byte) uint32 { panic("unimplemented") }
1414

15-
func (smle) PutUint32(b []byte, v uint32) { panic("unimplemented") }
15+
func (signMagLittleEndian) PutUint32(b []byte, v uint32) { panic("unimplemented") }
1616

17-
func (smle) Uint64(b []byte) uint64 {
17+
func (signMagLittleEndian) Uint64(b []byte) uint64 {
1818
y := int64(b[0]) |
1919
int64(b[1])<<8 |
2020
int64(b[2])<<16 |
@@ -30,6 +30,6 @@ func (smle) Uint64(b []byte) uint64 {
3030
return uint64(y)
3131
}
3232

33-
func (smle) PutUint64(b []byte, v uint64) { panic("unimplemented") }
33+
func (signMagLittleEndian) PutUint64(b []byte, v uint64) { panic("unimplemented") }
3434

35-
func (smle) String() string { return "smle" }
35+
func (signMagLittleEndian) String() string { return "signMagLittleEndian" }

patch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func Patch(old io.Reader, new io.Writer, patch io.Reader) error {
3737
DiffLen int64
3838
NewSize int64
3939
}
40-
err := binary.Read(patch, smle{}, &header)
40+
err := binary.Read(patch, signMagLittleEndian{}, &header)
4141
if err != nil {
4242
return err
4343
}
@@ -75,7 +75,7 @@ func Patch(old io.Reader, new io.Writer, patch io.Reader) error {
7575
var oldpos, newpos int64
7676
for newpos < header.NewSize {
7777
var ctrl struct{ Add, Copy, Seek int64 }
78-
err = binary.Read(cpfbz2, smle{}, &ctrl)
78+
err = binary.Read(cpfbz2, signMagLittleEndian{}, &ctrl)
7979
if err != nil {
8080
return err
8181
}

0 commit comments

Comments
 (0)