Skip to content

Commit

Permalink
Merge pull request #103 from aristanetworks/upstream
Browse files Browse the repository at this point in the history
tail: Minor code cleanup.
  • Loading branch information
Nino Kodabande authored Feb 7, 2017
2 parents 33107f3 + 74e17d0 commit faf842b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

var (
ErrStop = fmt.Errorf("tail should now stop")
ErrStop = errors.New("tail should now stop")
)

type Line struct {
Expand Down Expand Up @@ -250,7 +250,7 @@ func (tail *Tail) tailFileSync() {

tail.openReader()

var offset int64 = 0
var offset int64
var err error

// Read line by line.
Expand All @@ -273,10 +273,9 @@ func (tail *Tail) tailFileSync() {
if cooloff {
// Wait a second before seeking till the end of
// file when rate limit is reached.
msg := fmt.Sprintf(
"Too much log activity; waiting a second " +
"before resuming tailing")
tail.Lines <- &Line{msg, time.Now(), fmt.Errorf(msg)}
msg := ("Too much log activity; waiting a second " +
"before resuming tailing")
tail.Lines <- &Line{msg, time.Now(), errors.New(msg)}
select {
case <-time.After(time.Second):
case <-tail.Dying():
Expand Down

0 comments on commit faf842b

Please sign in to comment.