diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-06-11 14:40:38 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-06-15 07:05:56 -0400 |
commit | 200cfa41a434b7143620c2c252b3eb7ab3ef92f9 (patch) | |
tree | ccf0cb95297dc65d4dc8bd366963e2b037fb1a8b /libpod/container_internal.go | |
parent | 3f026eb6a682a68e69f9376b72157a8f084e575c (diff) | |
download | podman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.tar.gz podman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.tar.bz2 podman-200cfa41a434b7143620c2c252b3eb7ab3ef92f9.zip |
Turn on More linters
- misspell
- prealloc
- unparam
- nakedret
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index f6fc3c1a4..73e0b2118 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -239,7 +239,7 @@ func (c *Container) handleRestartPolicy(ctx context.Context) (restarted bool, er logrus.Debugf("Restarting container %s due to restart policy %s", c.ID(), c.config.RestartPolicy) // Need to check if dependencies are alive. - if err = c.checkDependenciesAndHandleError(ctx); err != nil { + if err = c.checkDependenciesAndHandleError(); err != nil { return false, err } @@ -513,7 +513,7 @@ func (c *Container) teardownStorage() error { // Reset resets state fields to default values. // It is performed before a refresh and clears the state after a reboot. // It does not save the results - assumes the database will do that for us. -func resetState(state *ContainerState) error { +func resetState(state *ContainerState) { state.PID = 0 state.ConmonPID = 0 state.Mountpoint = "" @@ -527,8 +527,6 @@ func resetState(state *ContainerState) error { state.StoppedByUser = false state.RestartPolicyMatch = false state.RestartCount = 0 - - return nil } // Refresh refreshes the container's state after a restart. @@ -756,7 +754,7 @@ func (c *Container) prepareToStart(ctx context.Context, recursive bool) (err err } if !recursive { - if err := c.checkDependenciesAndHandleError(ctx); err != nil { + if err := c.checkDependenciesAndHandleError(); err != nil { return err } } else { @@ -792,7 +790,7 @@ func (c *Container) prepareToStart(ctx context.Context, recursive bool) (err err } // checks dependencies are running and prints a helpful message -func (c *Container) checkDependenciesAndHandleError(ctx context.Context) error { +func (c *Container) checkDependenciesAndHandleError() error { notRunning, err := c.checkDependenciesRunning() if err != nil { return errors.Wrapf(err, "error checking dependencies for container %s", c.ID()) |