From 1cfa8d58f6ffd7202fe445c2986f0366022d46f9 Mon Sep 17 00:00:00 2001 From: Ting-Yu Wang Date: Tue, 3 Nov 2020 15:21:38 -0800 Subject: Fix more nogo tests PiperOrigin-RevId: 340536306 --- runsc/specutils/specutils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runsc/specutils') diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go index 45abc1425..7b923ddf4 100644 --- a/runsc/specutils/specutils.go +++ b/runsc/specutils/specutils.go @@ -19,6 +19,7 @@ package specutils import ( "encoding/json" "fmt" + "io" "io/ioutil" "os" "path" @@ -169,7 +170,7 @@ func ReadSpec(bundleDir string, conf *config.Config) (*specs.Spec, error) { // ReadSpecFromFile reads an OCI runtime spec from the given File, and // normalizes all relative paths into absolute by prepending the bundle dir. func ReadSpecFromFile(bundleDir string, specFile *os.File, conf *config.Config) (*specs.Spec, error) { - if _, err := specFile.Seek(0, os.SEEK_SET); err != nil { + if _, err := specFile.Seek(0, io.SeekStart); err != nil { return nil, fmt.Errorf("error seeking to beginning of file %q: %v", specFile.Name(), err) } specBytes, err := ioutil.ReadAll(specFile) -- cgit v1.2.3