Move from deprecated ioutil to os and io packages (#4364)

This commit is contained in:
KallyDev
2021-09-30 01:17:48 +08:00
committed by GitHub
parent 059fc32f00
commit c48fadc4a7
26 changed files with 71 additions and 84 deletions

View File

@ -18,7 +18,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"strings"
@ -630,9 +629,9 @@ func (StderrWriter) OpenWriter() (io.WriteCloser, error) {
return notClosable{os.Stderr}, nil
}
// OpenWriter returns ioutil.Discard that can't be closed.
// OpenWriter returns io.Discard that can't be closed.
func (DiscardWriter) OpenWriter() (io.WriteCloser, error) {
return notClosable{ioutil.Discard}, nil
return notClosable{io.Discard}, nil
}
// notClosable is an io.WriteCloser that can't be closed.