Преглед изворни кода

fix: check if file was closed

Jose Diaz-Gonzalez пре 2 година
родитељ
комит
cfa0a79845
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      cli/cmd/pack/pack.go

+ 3 - 1
cli/cmd/pack/pack.go

@@ -47,7 +47,9 @@ func (a *Agent) Build(ctx context.Context, opts *docker.BuildOpts, buildConfig *
 	if err != nil {
 		return err
 	}
-	defer file.Close()
+	if err := file.Close(); err != nil {
+		return err
+	}
 
 	buildOpts := packclient.BuildOptions{
 		RelativeBaseDir: filepath.Dir(absPath),