portald/floppy/floppy.go

21 lines
274 B
Go
Raw Normal View History

2023-06-07 17:43:58 -05:00
package floppy
import (
"io"
"golang.org/x/sync/errgroup"
)
func Floppy(a, b io.ReadWriter) error {
var g errgroup.Group
g.Go(func() error {
_, err := io.Copy(a, b)
return err
})
g.Go(func() error {
_, err := io.Copy(b, a)
return err
})
return g.Wait()
}