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:
@@ -14,7 +14,7 @@ func TestMsgMhfGetAchievementDetailedParse(t *testing.T) {
|
||||
bf.WriteUint32(0x12345678) // AckHandle
|
||||
bf.WriteUint32(54321) // CharID
|
||||
bf.WriteUint32(99999) // Unk1
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
|
||||
pkt := &MsgMhfGetAchievement{}
|
||||
err := pkt.Parse(bf, &clientctx.ClientContext{})
|
||||
@@ -36,7 +36,7 @@ func TestMsgMhfAddAchievementDetailedParse(t *testing.T) {
|
||||
bf.WriteUint8(42) // AchievementID
|
||||
bf.WriteUint16(12345) // Unk1
|
||||
bf.WriteUint16(0xFFFF) // Unk2 - max value
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
|
||||
pkt := &MsgMhfAddAchievement{}
|
||||
err := pkt.Parse(bf, &clientctx.ClientContext{})
|
||||
@@ -78,7 +78,7 @@ func TestMsgSysCastBinaryDetailedParse(t *testing.T) {
|
||||
bf.WriteUint8(tt.messageType)
|
||||
bf.WriteUint16(uint16(len(tt.payload)))
|
||||
bf.WriteBytes(tt.payload)
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
|
||||
pkt := &MsgSysCastBinary{}
|
||||
err := pkt.Parse(bf, &clientctx.ClientContext{})
|
||||
@@ -116,7 +116,7 @@ func TestMsgSysLogoutDetailedParse(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint8(tt.unk0)
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
|
||||
pkt := &MsgSysLogout{}
|
||||
err := pkt.Parse(bf, &clientctx.ClientContext{})
|
||||
@@ -144,7 +144,7 @@ func TestMsgSysBackStageDetailedParse(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint32(tt.ackHandle)
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
|
||||
pkt := &MsgSysBackStage{}
|
||||
err := pkt.Parse(bf, &clientctx.ClientContext{})
|
||||
@@ -171,7 +171,7 @@ func TestMsgSysPingDetailedParse(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint32(tt.ackHandle)
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
|
||||
pkt := &MsgSysPing{}
|
||||
err := pkt.Parse(bf, &clientctx.ClientContext{})
|
||||
@@ -200,7 +200,7 @@ func TestMsgSysTimeDetailedParse(t *testing.T) {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteBool(tt.getRemoteTime)
|
||||
bf.WriteUint32(tt.timestamp)
|
||||
bf.Seek(0, io.SeekStart)
|
||||
_, _ = bf.Seek(0, io.SeekStart)
|
||||
|
||||
pkt := &MsgSysTime{}
|
||||
err := pkt.Parse(bf, &clientctx.ClientContext{})
|
||||
|
||||
Reference in New Issue
Block a user