Skip to content

Commit

Permalink
Nedd to check return value of seek
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Oct 26, 2023
1 parent 8892008 commit 4abc245
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions providers/asrockrack/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f
// Try the special URL for e3c256d4i
a.log.V(2).WithValues("step", "2/4").Info("Try alternate URL")

Check warning on line 79 in providers/asrockrack/firmware.go

View check run for this annotation

Codecov / codecov/patch

providers/asrockrack/firmware.go#L79

Added line #L79 was not covered by tests
// Restart reader from start
reader.(*os.File).Seek(0, io.SeekStart)
err2 := a.uploadFirmware(ctx, "api/maintenance/firmware/firmware", reader, fileSize)
_, err2 := reader.(*os.File).Seek(0, io.SeekStart)
if err2 != nil {
err2 = a.uploadFirmware(ctx, "api/maintenance/firmware/firmware", reader, fileSize)

Check warning on line 83 in providers/asrockrack/firmware.go

View check run for this annotation

Codecov / codecov/patch

providers/asrockrack/firmware.go#L81-L83

Added lines #L81 - L83 were not covered by tests
}
if err2 != nil {
a.log.V(2).WithValues("step", "2/4").Info("Alternate URL err:" + err2.Error())

Check warning on line 86 in providers/asrockrack/firmware.go

View check run for this annotation

Codecov / codecov/patch

providers/asrockrack/firmware.go#L85-L86

Added lines #L85 - L86 were not covered by tests
// if also in err, report first error
Expand Down

0 comments on commit 4abc245

Please sign in to comment.