Skip to content

copyLoop without sync.WaitGroup

vbauerster requested to merge vbauerster/lyrebird:copy-loop into main

Small refactoring without affecting functionality. Pros:

  • -1 goroutine
  • no need for sync.WaitGroup

I'm closing a and b parameters as original code did, however every call site of copyLoop closing them as well though without error check. So closing a and b in copyLoop can be omitted (same as io.Copy never closes its args).

Merge request reports

Loading