@@ -69,30 +69,29 @@ func runRemove(ctx context.Context, backend compose.Service, opts removeOptions,
6969 }
7070
7171 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 {
7474 Services : services ,
7575 })
76- return "" , err
7776 })
7877 if err != nil {
7978 return err
8079 }
8180 }
8281
83- reosurces , err := backend .Remove (ctx , project , compose.RemoveOptions {
82+ resources , err := backend .Remove (ctx , project , compose.RemoveOptions {
8483 DryRun : true ,
8584 Services : services ,
8685 })
8786 if err != nil {
8887 return err
8988 }
9089
91- if len (reosurces ) == 0 {
90+ if len (resources ) == 0 {
9291 fmt .Println ("No stopped containers" )
9392 return nil
9493 }
95- msg := fmt .Sprintf ("Going to remove %s" , strings .Join (reosurces , ", " ))
94+ msg := fmt .Sprintf ("Going to remove %s" , strings .Join (resources , ", " ))
9695 if opts .force {
9796 fmt .Println (msg )
9897 } else {
@@ -105,12 +104,11 @@ func runRemove(ctx context.Context, backend compose.Service, opts removeOptions,
105104 }
106105 }
107106
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 {
110109 Volumes : opts .volumes ,
111110 Force : opts .force ,
112111 })
113- return "" , err
112+ return err
114113 })
115- return err
116114}
0 commit comments