File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,7 @@ func (r *Runner) handleOutput(
279279 info fs.FileInfo ,
280280 rp * reporter ,
281281) error {
282- switch {
283- case r .dryRun :
282+ if r .dryRun {
284283 pretty , err := diff .Pretty (filename , src , res )
285284 if err != nil {
286285 return err
@@ -291,15 +290,21 @@ func (r *Runner) handleOutput(
291290 }
292291
293292 return nil
293+ }
294+
295+ if ! r .listFiles && ! r .writeOutput {
296+ _ , _ = rp .Write (res )
294297
295- case r .listFiles :
298+ return nil
299+ }
300+
301+ if r .listFiles {
296302 if ! bytes .Equal (src , res ) {
297303 _ , _ = fmt .Fprintln (rp , filename )
298304 }
305+ }
299306
300- return nil
301-
302- case r .writeOutput :
307+ if r .writeOutput {
303308 if filename == "" {
304309 return errors .New ("no path to write out to" )
305310 }
@@ -317,13 +322,10 @@ func (r *Runner) handleOutput(
317322 return err
318323 }
319324
320- return nil
321-
322- default :
323- _ , _ = rp .Write (res )
324-
325325 return nil
326326 }
327+
328+ return nil
327329}
328330
329331func deref [T any ](v * T ) T { //nolint:ireturn
You can’t perform that action at this time.
0 commit comments