Skip to content

Commit 5cd1a48

Browse files
author
Luca Bruno
authored
Merge pull request coreos#345 from usabilla/seek-tail-previous
sdjournal: SeekTail should be followed by Previous, not Next
2 parents 9a6dca3 + cf46fcf commit 5cd1a48

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sdjournal/journal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ func (j *Journal) SeekHead() error {
946946
}
947947

948948
// SeekTail may be used to seek to the end of the journal, i.e. the most recent
949-
// available entry. This call must be followed by a call to Next before any
949+
// available entry. This call must be followed by a call to Previous before any
950950
// call to Get* will return data about the last element.
951951
func (j *Journal) SeekTail() error {
952952
sd_journal_seek_tail, err := getFunction("sd_journal_seek_tail")

sdjournal/journal_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ func TestJournalWait(t *testing.T) {
9696
if err := j.SeekTail(); err != nil {
9797
t.Fatalf("Error seeking to tail: %s", err)
9898
}
99-
if _, err := j.Next(); err != nil {
100-
t.Fatalf("Error retrieving next entry: %s", err)
99+
if _, err := j.Previous(); err != nil {
100+
t.Fatalf("Error retrieving previous entry: %s", err)
101101
}
102102

103103
var t1, t2 time.Time

0 commit comments

Comments
 (0)