fixed linting errors

This commit is contained in:
Christian Goll
2021-09-20 13:06:43 +02:00
parent dfd6ce3735
commit 341bdc2019
2 changed files with 7 additions and 4 deletions

View File

@@ -26,9 +26,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
nodemap[n.KernelVersion.Get()]++
}
fmt.Printf("%-35s %-6s\n", "KERNEL NAME","KERNEL VERSION" "NODES")
fmt.Printf("%-35s %-25s %-6s\n", "KERNEL NAME", "KERNEL VERSION", "NODES")
for _, k := range kernels {
fmt.Printf("%-35s %-25s %6d\n", k, kernel.GetVersion(k), nodemap[k])
fmt.Printf("%-35s %-25s %6d\n", k, kernel.GetKernelVersion(k), nodemap[k])
}
return nil

View File

@@ -98,7 +98,7 @@ func ListKernels() ([]string, error) {
return ret, nil
}
func Build(kernelVersion string, root string, kernelName string) (string, error) {
func Build(kernelVersion string, kernelName string, root string) (string, error) {
kernelImage := path.Join(root, "/boot/vmlinuz-"+kernelVersion)
kernelDrivers := path.Join(root, "/lib/modules/"+kernelVersion)
kernelDestination := KernelImage(kernelName)
@@ -166,7 +166,10 @@ func Build(kernelVersion string, root string, kernelName string) (string, error)
if err != nil {
return "", errors.Wrap(err, "Could not write kernel version")
}
file.Sync()
err = file.Sync()
if err != nil {
return "", errors.Wrap(err, "Could not sync kernel version")
}
return "Done", nil
}