mirror of https://github.com/perkeep/perkeep.git
Use io.Seek* constants instead of deprecated os.SEEK* constants
Change-Id: I4cc06bdcec87df16663981479d71e5732cdfb7d4
This commit is contained in:
parent
1afc3450c2
commit
a92f5ddfc8
|
@ -235,11 +235,11 @@ func (f *fileHandle) Readdir(int) ([]os.FileInfo, error) {
|
|||
|
||||
func (f *fileHandle) Seek(offset int64, whence int) (int64, error) {
|
||||
switch whence {
|
||||
case os.SEEK_SET:
|
||||
case io.SeekStart:
|
||||
f.off = offset
|
||||
case os.SEEK_CUR:
|
||||
case io.SeekCurrent:
|
||||
f.off += offset
|
||||
case os.SEEK_END:
|
||||
case io.SeekEnd:
|
||||
f.off = f.sf.Size() + offset
|
||||
default:
|
||||
return 0, os.ErrInvalid
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
"bytes"
|
||||
"image"
|
||||
"image/jpeg"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
@ -189,7 +190,7 @@ func TestRescale(t *testing.T) {
|
|||
t.Errorf("(scale) %v pixels not equal", name)
|
||||
}
|
||||
|
||||
_, err = f.Seek(0, os.SEEK_SET)
|
||||
_, err = f.Seek(0, io.SeekStart)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -238,7 +239,7 @@ func TestRescaleEXIF(t *testing.T) {
|
|||
t.Errorf("(scale) %v pixels not equal", name)
|
||||
}
|
||||
|
||||
_, err = f.Seek(0, os.SEEK_SET)
|
||||
_, err = f.Seek(0, io.SeekStart)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue