fix issues found by nilness

The conditions are always true so they can be removed. And in the case
of exportCheckpoint() the scope means addToTarFiles was overwritten and
thus when it looped over it later the slice was always empty.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-05-13 17:18:13 +02:00
parent 76e11cf5fc
commit 637c264e2e
5 changed files with 12 additions and 28 deletions

View File

@ -64,9 +64,6 @@ func prune(cmd *cobra.Command, args []string) error {
if !force {
reader := bufio.NewReader(os.Stdin)
fmt.Println("WARNING! This will remove all volumes not used by at least one container. The following volumes will be removed:")
if err != nil {
return err
}
listOptions.Filter, err = parse.FilterArgumentsIntoFilters(filter)
if err != nil {
return err