golang: Stop using io/ioutils

The package has been deprecated as part of 1.16 and the same
functionality is now provided by either the io or the os package.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio
2022-11-17 13:11:05 +01:00
parent 66aa330d0d
commit 16b8375095
16 changed files with 35 additions and 47 deletions

View File

@@ -7,7 +7,7 @@
package main
import (
"io/ioutil"
"io"
"os"
"path/filepath"
"testing"
@@ -36,7 +36,7 @@ func TestNewHexByteReaderStdin(t *testing.T) {
func TestHexByteReaderRead(t *testing.T) {
assert := assert.New(t)
dir, err := ioutil.TempDir("", "")
dir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatal(err)
}
@@ -68,7 +68,7 @@ func TestHexByteReaderRead(t *testing.T) {
assert.NoError(err)
reader := NewHexByteReader(file)
bytes, err := ioutil.ReadAll(reader)
bytes, err := io.ReadAll(reader)
if d.expectError {
assert.Errorf(err, "test[%d]: %+v", i, d)