Skip to content

Commit e85a0e9

Browse files
committed
chore: Stop using deprecated ioutil package
1 parent b338455 commit e85a0e9

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

pkg/skeletor/action_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package skeletor
22

33
import (
4-
"io/ioutil"
4+
"os"
55
"testing"
66

77
"get.porter.sh/porter/pkg/exec/builder"
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
func TestMixin_UnmarshalStep(t *testing.T) {
15-
b, err := ioutil.ReadFile("testdata/step-input.yaml")
15+
b, err := os.ReadFile("testdata/step-input.yaml")
1616
require.NoError(t, err)
1717

1818
var action Action

pkg/skeletor/execute_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package skeletor
33
import (
44
"bytes"
55
"context"
6-
"io/ioutil"
76
"os"
87
"path"
98
"testing"
@@ -36,7 +35,7 @@ func TestMixin_Execute(t *testing.T) {
3635
m := NewTestMixin(t)
3736

3837
m.Setenv(test.ExpectedCommandEnv, tc.wantCommand)
39-
mixinInputB, err := ioutil.ReadFile(tc.file)
38+
mixinInputB, err := os.ReadFile(tc.file)
4039
require.NoError(t, err)
4140

4241
m.In = bytes.NewBuffer(mixinInputB)

pkg/skeletor/schema_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package skeletor
22

33
import (
44
"fmt"
5-
"io/ioutil"
5+
"os"
66
"testing"
77

88
"github.com/ghodss/yaml" // We are not using go-yaml because of serialization problems with jsonschema, don't use this library elsewhere
@@ -17,7 +17,7 @@ func TestMixin_PrintSchema(t *testing.T) {
1717
m.PrintSchema()
1818
gotSchema := m.TestContext.GetOutput()
1919

20-
wantSchema, err := ioutil.ReadFile("schema/schema.json")
20+
wantSchema, err := os.ReadFile("schema/schema.json")
2121
require.NoError(t, err)
2222

2323
assert.Equal(t, string(wantSchema), gotSchema)
@@ -41,7 +41,7 @@ func TestMixin_ValidateSchema(t *testing.T) {
4141
for _, tc := range testcases {
4242
t.Run(tc.name, func(t *testing.T) {
4343
// Read the mixin input as a go dump
44-
mixinInputB, err := ioutil.ReadFile(tc.file)
44+
mixinInputB, err := os.ReadFile(tc.file)
4545
require.NoError(t, err)
4646
mixinInputMap := make(map[string]interface{})
4747
err = yaml.Unmarshal(mixinInputB, &mixinInputMap)

0 commit comments

Comments
 (0)