From a92f5ddfc823220b34e584852945150f194eea35 Mon Sep 17 00:00:00 2001 From: Paul Lindner Date: Sun, 3 Dec 2017 17:04:02 -0800 Subject: [PATCH] Use io.Seek* constants instead of deprecated os.SEEK* constants Change-Id: I4cc06bdcec87df16663981479d71e5732cdfb7d4 --- pkg/fileembed/fileembed.go | 6 +++--- pkg/images/images_test.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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) }