mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-19 01:47:43 +08:00

full diff:
- https://github.com/containerd/containerd/compare/v1.7.8...v1.7.9
- 5ae9b23c40...c9ee8491d7
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
20 lines
386 B
Go
20 lines
386 B
Go
package utilities
|
|
|
|
import (
|
|
"bytes"
|
|
"io"
|
|
)
|
|
|
|
// IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins
|
|
// at the start of the stream
|
|
func IOReaderFactory(r io.Reader) (func() io.Reader, error) {
|
|
b, err := io.ReadAll(r)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return func() io.Reader {
|
|
return bytes.NewReader(b)
|
|
}, nil
|
|
}
|