From bcced6bc10201da653edf9ccfe2efbc671095bbd Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sat, 4 Sep 2021 22:41:34 -0700 Subject: [PATCH] fix lint issues from staticcheck Specifically this fixes failures: ST1005, S1028, S1011 See #6 --- main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index a1bf6b8..b3a950a 100644 --- a/main.go +++ b/main.go @@ -112,7 +112,7 @@ func bootDeploy(workDir string, outDir string) error { "-o", outDir, "initramfs-extra") if !exists(cmd.Path) { - return errors.New("boot-deploy command not found.") + return errors.New("boot-deploy command not found") } cmd.Stdout = os.Stdout @@ -507,7 +507,7 @@ func getKernelReleaseFile() (string, error) { files, _ := filepath.Glob("/usr/share/kernel/*/kernel.release") // only one kernel flavor supported if len(files) != 1 { - return "", errors.New(fmt.Sprintf("Only one kernel release/flavor is supported, found: %q", files)) + return "", fmt.Errorf("only one kernel release/flavor is supported, found: %q", files) } return files[0], nil @@ -676,9 +676,7 @@ func getModuleDeps(modName string, modDir string) ([]string, error) { if modName != filepath.Base(stripExts(fields[0])) { continue } - for _, modPath := range fields { - deps = append(deps, modPath) - } + deps = append(deps, fields...) } if err := s.Err(); err != nil { log.Print("Unable to get module + dependencies: ", modName)