Skip to content

Commit

Permalink
hardcode io.Seekend for backwards compatibility with Go <1.7
Browse files Browse the repository at this point in the history
fix linux import
  • Loading branch information
kcking committed May 14, 2017
1 parent 5ab5ba3 commit 7bd3563
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions kr/kr_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"os"
"os/exec"

"github.com/kryptco/kr"
"github.com/urfave/cli"
)

Expand Down
4 changes: 2 additions & 2 deletions notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package kr

import (
"bufio"
"io"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -59,7 +58,8 @@ func OpenNotificationReader(id string) (r NotificationReader, err error) {
return
}
// some systems don't truncate correctly
file.Seek(0, io.SeekEnd)
// 2 = io.Seekend, but not added until Go 1.7
file.Seek(0, 2)
r = NotificationReader{
File: file,
lineReader: bufio.NewReader(file),
Expand Down

0 comments on commit 7bd3563

Please sign in to comment.