diff --git a/cmd/podman/root.go b/cmd/podman/root.go index d4c7e311e4..7685b67c6f 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -445,7 +445,6 @@ func configHook() { } func loggingHook() { - var found bool if debug { if logLevel != defaultLogLevel { fmt.Fprintf(os.Stderr, "Setting --log-level and --debug is not allowed\n") @@ -453,10 +452,8 @@ func loggingHook() { } logLevel = "debug" } - if slices.Contains(common.LogLevels, strings.ToLower(logLevel)) { - found = true - } - if !found { + + if !slices.Contains(common.LogLevels, strings.ToLower(logLevel)) { fmt.Fprintf(os.Stderr, "Log Level %q is not supported, choose from: %s\n", logLevel, strings.Join(common.LogLevels, ", ")) os.Exit(1) } diff --git a/libpod/container_commit.go b/libpod/container_commit.go index 00dd694d74..cef7bf4011 100644 --- a/libpod/container_commit.go +++ b/libpod/container_commit.go @@ -131,8 +131,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai // Only include anonymous named volumes added by the user by // default. for _, v := range c.config.NamedVolumes { - include := slices.Contains(c.config.UserVolumes, v.Dest) - if include { + if slices.Contains(c.config.UserVolumes, v.Dest) { vol, err := c.runtime.GetVolume(v.Name) if err != nil { return nil, fmt.Errorf("volume %s used in container %s has been removed: %w", v.Name, c.ID(), err) diff --git a/libpod/plugin/volume_api.go b/libpod/plugin/volume_api.go index 25639fdb5b..0e6ff91350 100644 --- a/libpod/plugin/volume_api.go +++ b/libpod/plugin/volume_api.go @@ -107,9 +107,7 @@ func validatePlugin(newPlugin *VolumePlugin) error { return fmt.Errorf("unmarshalling plugin %s activation response: %w", newPlugin.Name, err) } - foundVolume := slices.Contains(respStruct.Implements, volumePluginType) - - if !foundVolume { + if !slices.Contains(respStruct.Implements, volumePluginType) { return fmt.Errorf("plugin %s does not implement volume plugin, instead provides %s: %w", newPlugin.Name, strings.Join(respStruct.Implements, ", "), ErrNotVolumePlugin) }