Skip to content

Commit

Permalink
Merge pull request #345 from usabilla/seek-tail-previous
Browse files Browse the repository at this point in the history
sdjournal: SeekTail should be followed by Previous, not Next
  • Loading branch information
Luca Bruno committed Mar 3, 2021
2 parents 9a6dca3 + cf46fcf commit 5cd1a48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sdjournal/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ func (j *Journal) SeekHead() error {
}

// SeekTail may be used to seek to the end of the journal, i.e. the most recent
// available entry. This call must be followed by a call to Next before any
// available entry. This call must be followed by a call to Previous before any
// call to Get* will return data about the last element.
func (j *Journal) SeekTail() error {
sd_journal_seek_tail, err := getFunction("sd_journal_seek_tail")
Expand Down
4 changes: 2 additions & 2 deletions sdjournal/journal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ func TestJournalWait(t *testing.T) {
if err := j.SeekTail(); err != nil {
t.Fatalf("Error seeking to tail: %s", err)
}
if _, err := j.Next(); err != nil {
t.Fatalf("Error retrieving next entry: %s", err)
if _, err := j.Previous(); err != nil {
t.Fatalf("Error retrieving previous entry: %s", err)
}

var t1, t2 time.Time
Expand Down

0 comments on commit 5cd1a48

Please sign in to comment.