diff --git a/pkg/fileembed/fileembed.go b/pkg/fileembed/fileembed.go index e40045155..9345b07e9 100644 --- a/pkg/fileembed/fileembed.go +++ b/pkg/fileembed/fileembed.go @@ -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 diff --git a/pkg/images/images_test.go b/pkg/images/images_test.go index 627d2049d..2d7c92f75 100644 --- a/pkg/images/images_test.go +++ b/pkg/images/images_test.go @@ -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) }