refactor: move from io/ioutil to io and os packages (#1068)

* refactor: move from io/ioutil to io and os packages

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* build: update snapcraft `go-channel` to 1.17

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2022-01-21 19:50:53 +11:00
committed by GitHub
parent f8bcaca4c9
commit e347090571
5 changed files with 17 additions and 10 deletions
+1 -2
View File
@@ -3,7 +3,6 @@ package yqlib
import (
"fmt"
"io"
"io/ioutil"
"os"
)
@@ -77,7 +76,7 @@ func createTempFile() (*os.File, error) {
return nil, err
}
file, err := ioutil.TempFile("", "temp")
file, err := os.CreateTemp("", "temp")
if err != nil {
return nil, err
}