Remove calls to Go's deprecated "io/ioutil"

This commit is contained in:
Nigel Tao committed 2021-08-22 11:17:34 +10:00
1 parent 788479dd64
commit 226c476994
31 files changed
+73 -93

No files matched your search

+3 -3
View File
@@ -36,7 +36,7 @@ import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"io"
"os"
)
@@ -113,7 +113,7 @@ func emit() error {
}
filename := fmt.Sprintf("cbor-rfc-7049-examples/%02d.cbor", fileNumber)
fileNumber++
err := ioutil.WriteFile(filename, contents, 0644)
err := os.WriteFile(filename, contents, 0644)
contents = nil
return err
}
@@ -129,7 +129,7 @@ func readExampleTable() ([]byte, error) {
appendixA := []byte("Appendix A. Examples\n\n")
ruler := []byte("+------------------------------+------------------------------------+\n")
src, err := ioutil.ReadAll(os.Stdin)
src, err := io.ReadAll(os.Stdin)
if err != nil {
return nil, err
}