Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
check: Fix golint errors.
Browse files Browse the repository at this point in the history
golint is now causing builds to fail due to the need to simplify
certain functions that return errors.

Fixes #573.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Sep 19, 2017
1 parent f8f8c6c commit a11df0b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
6 changes: 1 addition & 5 deletions cc-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,7 @@ func hostIsClearContainersCapable(cpuinfoFile string) error {
return err
}

if err = checkKernelModules(requiredKernelModules); err != nil {
return err
}

return nil
return checkKernelModules(requiredKernelModules)
}

var ccCheckCLICommand = cli.Command{
Expand Down
6 changes: 1 addition & 5 deletions create.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ func create(containerID, bundlePath, console, pidFilePath string, detach bool,
// Creation of PID file has to be the last thing done in the create
// because containerd considers the create complete after this file
// is created.
if err := createPIDFile(pidFilePath, process.Pid); err != nil {
return err
}

return nil
return createPIDFile(pidFilePath, process.Pid)
}

func getKernelParams(containerID string) []vc.Param {
Expand Down
6 changes: 1 addition & 5 deletions kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ func kill(containerID, signal string, all bool) error {
return fmt.Errorf("Container %s not ready or running, cannot send a signal", containerID)
}

if err := vci.KillContainer(podID, containerID, signum, all); err != nil {
return err
}

return nil
return vci.KillContainer(podID, containerID, signum, all)
}

func processSignal(signal string) (syscall.Signal, error) {
Expand Down
6 changes: 2 additions & 4 deletions list.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,8 @@ func (f *formatTabular) Write(state []fullContainerState, showAll bool, file *os
fmt.Fprintf(w, "\n")
}
}
if err := w.Flush(); err != nil {
return err
}
return nil

return w.Flush()
}

func (f *formatJSON) Write(state []fullContainerState, showAll bool, file *os.File) error {
Expand Down

0 comments on commit a11df0b

Please sign in to comment.