From 200cfa41a434b7143620c2c252b3eb7ab3ef92f9 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 11 Jun 2020 14:40:38 -0400 Subject: Turn on More linters - misspell - prealloc - unparam - nakedret Signed-off-by: Daniel J Walsh --- libpod/container_internal.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libpod/container_internal.go') 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()) -- cgit v1.2.3-54-g00ecf