Skip to content

Commit

Permalink
fix(lint): remove redundant check (#2)
Browse files Browse the repository at this point in the history
Remove a check that is unreachable because uint64 can never be < 0.
The intended effect is already done by the underlying journal, which
will return a non-nil err in the event of an error.

Signed-off-by: Erik Swanson <[email protected]>
  • Loading branch information
eriksw authored Nov 6, 2020
1 parent 523ceb3 commit ee3cdbc
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"fmt"
"io"
"os"
"syscall"
"time"

"github.com/coreos/go-systemd/v22/sdjournal"
Expand Down Expand Up @@ -174,9 +173,6 @@ func (r *Reader) Next(cancel canceler) (*sdjournal.JournalEntry, error) {
}

switch {
// error while reading next entry
case c < 0:
return nil, fmt.Errorf("error while reading next entry %+v", syscall.Errno(-c))
// no new entry, so wait
case c == 0:
hasNewEntry, err := r.checkForNewEvents()
Expand Down

0 comments on commit ee3cdbc

Please sign in to comment.