mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
internal/builtin: deprecate io/ioutil (#314)
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
This commit is contained in:
parent
3b589ff6b2
commit
10e1b10d86
@ -7,7 +7,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/mitchellh/go-homedir"
|
||||
@ -132,7 +131,7 @@ func getSrc(v cty.Value) (string, bool, error) {
|
||||
|
||||
switch {
|
||||
case !content.IsNull():
|
||||
file, err := ioutil.TempFile("", "tf-file-content")
|
||||
file, err := os.CreateTemp("", "tf-file-content")
|
||||
if err != nil {
|
||||
return "", true, err
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ package localexec
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
@ -38,7 +37,7 @@ func TestResourceProvider_Apply(t *testing.T) {
|
||||
}
|
||||
|
||||
// Check the file
|
||||
raw, err := ioutil.ReadFile("test_out")
|
||||
raw, err := os.ReadFile("test_out")
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
@ -182,7 +181,7 @@ func collectScripts(v cty.Value) ([]io.ReadCloser, error) {
|
||||
|
||||
var r []io.ReadCloser
|
||||
for _, script := range scripts {
|
||||
r = append(r, ioutil.NopCloser(bytes.NewReader([]byte(script))))
|
||||
r = append(r, io.NopCloser(bytes.NewReader([]byte(script))))
|
||||
}
|
||||
|
||||
return r, nil
|
||||
|
Loading…
Reference in New Issue
Block a user