pkg/vm/stack: fix unused binary.Read() result in testReadInt64()
GolangCI: Error return value of binary.Read is not checked (from errcheck)
This commit is contained in:
parent
d6c3f74e3c
commit
613bad36e0
2 changed files with 4 additions and 3 deletions
|
@ -64,7 +64,7 @@ func TestByteArrConversion(t *testing.T) {
|
|||
ba, err := a.ByteArray()
|
||||
assert.Nil(t, err)
|
||||
|
||||
assert.Equal(t, num, testReadInt64(ba.val))
|
||||
assert.Equal(t, num, testReadInt64(t, ba.val))
|
||||
|
||||
have, err := ba.Integer()
|
||||
assert.Nil(t, err)
|
||||
|
|
|
@ -36,14 +36,15 @@ func testMakeStackInt(t *testing.T, num int64) *Int {
|
|||
return a
|
||||
}
|
||||
|
||||
func testReadInt64(data []byte) int64 {
|
||||
func testReadInt64(t *testing.T, data []byte) int64 {
|
||||
var ret int64
|
||||
var arr [8]byte
|
||||
|
||||
// expands or shrinks data automatically
|
||||
copy(arr[:], data)
|
||||
buf := bytes.NewBuffer(arr[:])
|
||||
binary.Read(buf, binary.LittleEndian, &ret)
|
||||
err := binary.Read(buf, binary.LittleEndian, &ret)
|
||||
assert.Nil(t, err)
|
||||
return ret
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue