Skip to content

Commit b26e826

Browse files
committed
chore: move away from "io/ioutil"
"io/ioutil" was deprecated in Go 1.16.
1 parent 5ecb9ae commit b26e826

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sops/data.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package sops
22

33
import (
44
"fmt"
5-
"io/ioutil"
5+
"io"
6+
"os"
67
"path"
78
"strings"
89

@@ -27,7 +28,7 @@ func newSummaryError(summary string, err error) summaryError {
2728

2829
func getFileData(sourceFile types.String, inputType types.String) (data map[string]string, raw string, err error) {
2930
sourceFileValue := sourceFile.ValueString()
30-
content, err := ioutil.ReadFile(sourceFileValue)
31+
content, err := os.ReadFile(sourceFileValue)
3132
if err != nil {
3233
return nil, "", newSummaryError("Error reading file", err)
3334
}
@@ -62,7 +63,7 @@ func getFileData(sourceFile types.String, inputType types.String) (data map[stri
6263
}
6364

6465
func getExternalData(source types.String, inputType types.String) (data map[string]string, raw string, err error) {
65-
content, err := ioutil.ReadAll(strings.NewReader(source.ValueString()))
66+
content, err := io.ReadAll(strings.NewReader(source.ValueString()))
6667
if err != nil {
6768
return nil, "", newSummaryError("Error reading source", err)
6869
}

0 commit comments

Comments
 (0)