internal/execabs: replace ioutil.WriteFile with os.WriteFile

Fixes #45532.

Change-Id: I844acd50d6fa1ce918969bbb52f79dd7412d289f
Reviewed-on: https://go-review.googlesource.com/c/go/+/309350
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
Manlio Perillo 2021-04-12 21:46:14 +02:00 committed by Ian Lance Taylor
parent aad13cbb74
commit cccd3ba912

View file

@ -42,7 +42,7 @@ func TestCommand(t *testing.T) {
executable += ".exe"
}
if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil {
t.Fatalf("ioutil.WriteFile failed: %s", err)
t.Fatalf("os.WriteFile failed: %s", err)
}
cwd, err := os.Getwd()
if err != nil {
@ -77,7 +77,7 @@ func TestLookPath(t *testing.T) {
executable += ".exe"
}
if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil {
t.Fatalf("ioutil.WriteFile failed: %s", err)
t.Fatalf("os.WriteFile failed: %s", err)
}
cwd, err := os.Getwd()
if err != nil {