From 128ee414b96e985e351ddbd44c64ff0bd3ed8ce8 Mon Sep 17 00:00:00 2001 From: Reagan Lopez Date: Mon, 23 Dec 2019 11:32:17 -0800 Subject: [PATCH] Fix lint errors Signed-off-by: Reagan Lopez --- builder/bundles.go | 4 ++-- builder/helpers.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/builder/bundles.go b/builder/bundles.go index ddd28e3..358ac8a 100644 --- a/builder/bundles.go +++ b/builder/bundles.go @@ -451,7 +451,7 @@ func installFilesystem(chrootDir string, packagerCmd []string, downloadRetries i pkgFull := fileSystemInfo.name + "-" + fileSystemInfo.version + "." + fileSystemInfo.arch rpm := pkgFull + ".rpm" var rpmFullPath string - for cacheDir, _ := range repos[fileSystemInfo.repo].cacheDirs { + for cacheDir := range repos[fileSystemInfo.repo].cacheDirs { rpmFullPath = filepath.Join(cacheDir, rpm) // assuming the full path based on Clear Linux repo and naming conventions _, err = os.Stat(rpmFullPath) if err == nil { @@ -663,7 +663,7 @@ func installBundleToFull(packagerCmd []string, baseDir string, bundle *bundle, d } var rpmFullPath string pkgFull := pkgInfo.name + "-" + pkgInfo.version + "." + pkgInfo.arch - for cacheDir, _ := range repos[pkgInfo.repo].cacheDirs { + for cacheDir := range repos[pkgInfo.repo].cacheDirs { rpmFullPath = filepath.Join(cacheDir, rpm) // assuming the full path based on Clear Linux repo and naming conventions _, err = os.Stat(rpmFullPath) if err == nil { diff --git a/builder/helpers.go b/builder/helpers.go index 9e570b5..037d837 100644 --- a/builder/helpers.go +++ b/builder/helpers.go @@ -85,6 +85,9 @@ func TerminalWidth() (int, error) { cmd := exec.Command("stty", "size") cmd.Stdin = os.Stdin out, err := cmd.Output() + if err != nil { + return 0, err + } outStrs := strings.Fields(string(out)) if len(outStrs) != 2 {