mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
fix: resolve all remaining lint errors (errcheck) across 49 files
Fix unchecked error returns on bf.Seek(), db.Exec(), QueryRow().Scan(), pkt.Build(), logger.Sync(), and binary.Write() calls. The linter now passes with 0 errors, build compiles, and all tests pass with -race.
This commit is contained in:
@@ -22,7 +22,7 @@ func UnpackSimple(data []byte) []byte {
|
||||
header := bf.ReadUint32()
|
||||
|
||||
if header == 0x1A524B4A {
|
||||
bf.Seek(0x2, io.SeekCurrent)
|
||||
_, _ = bf.Seek(0x2, io.SeekCurrent)
|
||||
jpkType := bf.ReadUint16()
|
||||
|
||||
switch jpkType {
|
||||
@@ -30,7 +30,7 @@ func UnpackSimple(data []byte) []byte {
|
||||
startOffset := bf.ReadInt32()
|
||||
outSize := bf.ReadInt32()
|
||||
outBuffer := make([]byte, outSize)
|
||||
bf.Seek(int64(startOffset), io.SeekStart)
|
||||
_, _ = bf.Seek(int64(startOffset), io.SeekStart)
|
||||
ProcessDecode(bf, outBuffer)
|
||||
|
||||
return outBuffer
|
||||
|
||||
@@ -73,7 +73,7 @@ func TestUnpackSimple_JPKHeader(t *testing.T) {
|
||||
}
|
||||
|
||||
// Verify the header bytes are correct
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
header := bf.ReadUint32()
|
||||
if header != 0x1A524B4A {
|
||||
t.Errorf("Header = 0x%X, want 0x1A524B4A", header)
|
||||
@@ -104,7 +104,7 @@ func TestReadByte(t *testing.T) {
|
||||
bf.WriteUint8(0x42)
|
||||
bf.WriteUint8(0xAB)
|
||||
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
b1 := ReadByte(bf)
|
||||
b2 := ReadByte(bf)
|
||||
|
||||
@@ -228,7 +228,7 @@ func BenchmarkReadByte(b *testing.B) {
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
_ = ReadByte(bf)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user