Skip to content

Commit 74e17d0

Browse files
committed
tail: Minor code cleanup.
Change-Id: Ib33db2c41cfd6117a9e9bfe64eab002f2b87331d
1 parent 915e5fe commit 74e17d0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tail.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
)
2323

2424
var (
25-
ErrStop = fmt.Errorf("tail should now stop")
25+
ErrStop = errors.New("tail should now stop")
2626
)
2727

2828
type Line struct {
@@ -250,7 +250,7 @@ func (tail *Tail) tailFileSync() {
250250

251251
tail.openReader()
252252

253-
var offset int64 = 0
253+
var offset int64
254254
var err error
255255

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

0 commit comments

Comments
 (0)