Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fls.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func LineFile(file *os.File) *File {
func (file *File) SeekLine(lines int64, whence int) (int64, error) {

// return error on bad whence
if whence < 0 || whence > 2 {
if whence < io.SeekStart || whence > io.SeekEnd {
return file.Seek(0, whence)
}

Expand All @@ -37,7 +37,7 @@ func (file *File) SeekLine(lines int64, whence int) (int64, error) {
matchCount := int64(0)

// seekBack ignores first match
// allows 0 to go to begining of current line
// allows 0 to go to beginning of current line
if seekBack {
matchCount = -1
}
Expand Down