mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
Replace ioutil with io and os (#10541)
* Replace ioutil with io and os * Fix build errors
This commit is contained in:
committed by
GitHub
parent
982de94428
commit
d2f4a8cc7c
@@ -3,7 +3,6 @@ package testdata
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
ioAlias "io/ioutil"
|
||||
"math/big"
|
||||
osAlias "os"
|
||||
"path/filepath"
|
||||
@@ -15,5 +14,5 @@ func UseAliasedPackages() {
|
||||
p := filepath.Join(tempDir(), fmt.Sprintf("/%d", randPath))
|
||||
_ = osAlias.MkdirAll(p, osAlias.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
someFile := filepath.Join(p, "some.txt")
|
||||
_ = ioAlias.WriteFile(someFile, []byte("hello"), osAlias.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
_ = osAlias.WriteFile(someFile, []byte("hello"), osAlias.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package testdata
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/big"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -23,5 +22,5 @@ func UseOsMkdirAllAndWriteFile() {
|
||||
p := filepath.Join(tempDir(), fmt.Sprintf("/%d", randPath))
|
||||
_ = os.MkdirAll(p, os.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
someFile := filepath.Join(p, "some.txt")
|
||||
_ = ioutil.WriteFile(someFile, []byte("hello"), os.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
_ = os.WriteFile(someFile, []byte("hello"), os.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user