refactor: move from io/ioutil to io and os package
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>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package needle
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@@ -31,7 +30,7 @@ func TestAppend(t *testing.T) {
|
||||
Padding: nil, // Padding []byte `comment:"Aligned to 8 bytes"`
|
||||
}
|
||||
|
||||
tempFile, err := ioutil.TempFile("", ".dat")
|
||||
tempFile, err := os.CreateTemp("", ".dat")
|
||||
if err != nil {
|
||||
t.Errorf("Fail TempFile. %v", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user