diff --git a/commands/diskusage.go b/commands/diskusage.go index 372bd583..6286bb5f 100644 --- a/commands/diskusage.go +++ b/commands/diskusage.go @@ -40,7 +40,7 @@ func runDiskUsage(dockerCli command.Cli, opts duOptions) error { for _, di := range dis { if di.Err != nil { - return err + return di.Err } } diff --git a/commands/prune.go b/commands/prune.go index d8ae9b43..730daceb 100644 --- a/commands/prune.go +++ b/commands/prune.go @@ -61,7 +61,7 @@ func runPrune(dockerCli command.Cli, opts pruneOptions) error { for _, di := range dis { if di.Err != nil { - return err + return di.Err } }