mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
Remove uses of deprecated io/ioutil
The package has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -2,7 +2,6 @@ package progress
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"time"
|
||||
|
||||
"github.com/moby/buildkit/client"
|
||||
@ -24,7 +23,7 @@ func FromReader(w Writer, name string, rc io.ReadCloser) {
|
||||
Vertexes: []*client.Vertex{&vtx},
|
||||
})
|
||||
|
||||
_, err := io.Copy(ioutil.Discard, rc)
|
||||
_, err := io.Copy(io.Discard, rc)
|
||||
|
||||
tm2 := time.Now()
|
||||
vtx2 := vtx
|
||||
|
@ -3,7 +3,6 @@ package progress
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
@ -88,7 +87,7 @@ func NewPrinter(ctx context.Context, w io.Writer, out console.File, mode string)
|
||||
var c console.Console
|
||||
switch mode {
|
||||
case PrinterModeQuiet:
|
||||
w = ioutil.Discard
|
||||
w = io.Discard
|
||||
case PrinterModeAuto, PrinterModeTty:
|
||||
if cons, err := console.ConsoleFromFile(out); err == nil {
|
||||
c = cons
|
||||
|
Reference in New Issue
Block a user