mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
internal/e2e: deprecate io/ioutil (#341)
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
This commit is contained in:
parent
ebe331fdd3
commit
6b1fe8b7a9
@ -7,7 +7,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -165,7 +164,7 @@ func (b *binary) OpenFile(path ...string) (*os.File, error) {
|
|||||||
// directory.
|
// directory.
|
||||||
func (b *binary) ReadFile(path ...string) ([]byte, error) {
|
func (b *binary) ReadFile(path ...string) ([]byte, error) {
|
||||||
flatPath := b.Path(path...)
|
flatPath := b.Path(path...)
|
||||||
return ioutil.ReadFile(flatPath)
|
return os.ReadFile(flatPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FileExists is a helper for easily testing whether a particular file
|
// FileExists is a helper for easily testing whether a particular file
|
||||||
@ -235,7 +234,7 @@ func (b *binary) SetLocalState(state *states.State) error {
|
|||||||
|
|
||||||
func GoBuild(pkgPath, tmpPrefix string) string {
|
func GoBuild(pkgPath, tmpPrefix string) string {
|
||||||
dir, prefix := filepath.Split(tmpPrefix)
|
dir, prefix := filepath.Split(tmpPrefix)
|
||||||
tmpFile, err := ioutil.TempFile(dir, prefix)
|
tmpFile, err := os.CreateTemp(dir, prefix)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user