@@ -69,30 +69,29 @@ func runRemove(ctx context.Context, backend compose.Service, opts removeOptions,
69
69
}
70
70
71
71
if opts .stop {
72
- _ , err = progress .Run (ctx , func (ctx context.Context ) ( string , error ) {
73
- err := backend .Stop (ctx , project , compose.StopOptions {
72
+ err = progress .Run (ctx , func (ctx context.Context ) error {
73
+ return backend .Stop (ctx , project , compose.StopOptions {
74
74
Services : services ,
75
75
})
76
- return "" , err
77
76
})
78
77
if err != nil {
79
78
return err
80
79
}
81
80
}
82
81
83
- reosurces , err := backend .Remove (ctx , project , compose.RemoveOptions {
82
+ resources , err := backend .Remove (ctx , project , compose.RemoveOptions {
84
83
DryRun : true ,
85
84
Services : services ,
86
85
})
87
86
if err != nil {
88
87
return err
89
88
}
90
89
91
- if len (reosurces ) == 0 {
90
+ if len (resources ) == 0 {
92
91
fmt .Println ("No stopped containers" )
93
92
return nil
94
93
}
95
- msg := fmt .Sprintf ("Going to remove %s" , strings .Join (reosurces , ", " ))
94
+ msg := fmt .Sprintf ("Going to remove %s" , strings .Join (resources , ", " ))
96
95
if opts .force {
97
96
fmt .Println (msg )
98
97
} else {
@@ -105,12 +104,11 @@ func runRemove(ctx context.Context, backend compose.Service, opts removeOptions,
105
104
}
106
105
}
107
106
108
- _ , err = progress .Run (ctx , func (ctx context.Context ) ( string , error ) {
109
- _ , err = backend .Remove (ctx , project , compose.RemoveOptions {
107
+ return progress .Run (ctx , func (ctx context.Context ) error {
108
+ _ , err : = backend .Remove (ctx , project , compose.RemoveOptions {
110
109
Volumes : opts .volumes ,
111
110
Force : opts .force ,
112
111
})
113
- return "" , err
112
+ return err
114
113
})
115
- return err
116
114
}
0 commit comments