@@ -2,7 +2,7 @@ package cmd
2
2
3
3
import (
4
4
"bytes"
5
- "io/ioutil "
5
+ "io"
6
6
"os"
7
7
"strings"
8
8
"testing"
@@ -34,7 +34,7 @@ func TestMain(t *testing.T) {
34
34
cmd .SetErr (c )
35
35
cmd .SetOut (bytes .NewBufferString ("" ))
36
36
cmd .Execute ()
37
- out , err := ioutil .ReadAll (c ) // Read buffer to bytes
37
+ out , err := io .ReadAll (c ) // Read buffer to bytes
38
38
if err != nil {
39
39
t .Fatal (err )
40
40
}
@@ -54,7 +54,7 @@ func TestMain(t *testing.T) {
54
54
cmd .SetErr (b )
55
55
cmd .SetOut (bytes .NewBufferString ("" ))
56
56
cmd .Execute ()
57
- out , err := ioutil .ReadAll (b ) // Read buffer to bytes
57
+ out , err := io .ReadAll (b ) // Read buffer to bytes
58
58
if err != nil {
59
59
t .Fatal (err )
60
60
}
@@ -75,7 +75,7 @@ func TestMain(t *testing.T) {
75
75
cmd .SetErr (b )
76
76
cmd .SetOut (bytes .NewBufferString ("" ))
77
77
cmd .Execute ()
78
- out , err := ioutil .ReadAll (b ) // Read buffer to bytes
78
+ out , err := io .ReadAll (b ) // Read buffer to bytes
79
79
if err != nil {
80
80
t .Fatal (err )
81
81
}
@@ -88,7 +88,7 @@ func TestMain(t *testing.T) {
88
88
// From stdin
89
89
args = []string {"-" }
90
90
stdin := bytes .NewBufferString ("" )
91
- inputBuf , err := ioutil .ReadFile ("../fixtures/input/empty/file.yaml" )
91
+ inputBuf , err := os .ReadFile ("../fixtures/input/empty/file.yaml" )
92
92
if err != nil {
93
93
t .Fatal (err )
94
94
}
@@ -100,7 +100,7 @@ func TestMain(t *testing.T) {
100
100
cmd .SetErr (b )
101
101
cmd .SetOut (bytes .NewBufferString ("" ))
102
102
cmd .Execute ()
103
- out , err = ioutil .ReadAll (b ) // Read buffer to bytes
103
+ out , err = io .ReadAll (b ) // Read buffer to bytes
104
104
if err != nil {
105
105
t .Fatal (err )
106
106
}
@@ -120,16 +120,16 @@ func TestMain(t *testing.T) {
120
120
cmd .SetOut (b )
121
121
cmd .SetErr (e )
122
122
cmd .Execute ()
123
- out , err := ioutil .ReadAll (b ) // Read buffer to bytes
123
+ out , err := io .ReadAll (b ) // Read buffer to bytes
124
124
if err != nil {
125
125
t .Fatal (err )
126
126
}
127
- stderr , err := ioutil .ReadAll (e ) // Read buffer to bytes
127
+ stderr , err := io .ReadAll (e ) // Read buffer to bytes
128
128
if err != nil {
129
129
t .Fatal (err )
130
130
}
131
131
132
- buf , err := ioutil .ReadFile ("../fixtures/output/all.yaml" )
132
+ buf , err := os .ReadFile ("../fixtures/output/all.yaml" )
133
133
if err != nil {
134
134
t .Fatal (err )
135
135
}
@@ -148,12 +148,12 @@ func TestMain(t *testing.T) {
148
148
cmd .SetArgs (args )
149
149
cmd .SetOut (b )
150
150
cmd .Execute ()
151
- out , err := ioutil .ReadAll (b ) // Read buffer to bytes
151
+ out , err := io .ReadAll (b ) // Read buffer to bytes
152
152
if err != nil {
153
153
t .Fatal (err )
154
154
}
155
155
156
- buf , err := ioutil .ReadFile ("../fixtures/output/ignored-secret.yaml" )
156
+ buf , err := os .ReadFile ("../fixtures/output/ignored-secret.yaml" )
157
157
if err != nil {
158
158
t .Fatal (err )
159
159
}
@@ -166,7 +166,7 @@ func TestMain(t *testing.T) {
166
166
167
167
t .Run ("will read from STDIN" , func (t * testing.T ) {
168
168
stdin := bytes .NewBufferString ("" )
169
- inputBuf , err := ioutil .ReadFile ("../fixtures/input/nonempty/full.yaml" )
169
+ inputBuf , err := os .ReadFile ("../fixtures/input/nonempty/full.yaml" )
170
170
if err != nil {
171
171
t .Fatal (err )
172
172
}
@@ -180,12 +180,12 @@ func TestMain(t *testing.T) {
180
180
cmd .SetOut (stdout )
181
181
cmd .SetIn (stdin )
182
182
cmd .Execute ()
183
- out , err := ioutil .ReadAll (stdout ) // Read buffer to bytes
183
+ out , err := io .ReadAll (stdout ) // Read buffer to bytes
184
184
if err != nil {
185
185
t .Fatal (err )
186
186
}
187
187
188
- buf , err := ioutil .ReadFile ("../fixtures/output/stdin-full.yaml" )
188
+ buf , err := os .ReadFile ("../fixtures/output/stdin-full.yaml" )
189
189
if err != nil {
190
190
t .Fatal (err )
191
191
}
@@ -198,7 +198,7 @@ func TestMain(t *testing.T) {
198
198
199
199
t .Run ("will return invalid yaml error from STDIN" , func (t * testing.T ) {
200
200
stdin := bytes .NewBufferString ("" )
201
- inputBuf , err := ioutil .ReadFile ("../fixtures/input/invalid.yaml" )
201
+ inputBuf , err := os .ReadFile ("../fixtures/input/invalid.yaml" )
202
202
if err != nil {
203
203
t .Fatal (err )
204
204
}
@@ -213,7 +213,7 @@ func TestMain(t *testing.T) {
213
213
cmd .SetOut (bytes .NewBufferString ("" ))
214
214
cmd .SetIn (stdin )
215
215
cmd .Execute ()
216
- out , err := ioutil .ReadAll (stderr ) // Read buffer to bytes
216
+ out , err := io .ReadAll (stderr ) // Read buffer to bytes
217
217
if err != nil {
218
218
t .Fatal (err )
219
219
}
@@ -239,7 +239,7 @@ func TestMain(t *testing.T) {
239
239
cmd .SetErr (b )
240
240
cmd .SetOut (bytes .NewBufferString ("" ))
241
241
cmd .Execute ()
242
- out , err := ioutil .ReadAll (b ) // Read buffer to bytes
242
+ out , err := io .ReadAll (b ) // Read buffer to bytes
243
243
if err != nil {
244
244
t .Fatal (err )
245
245
}
0 commit comments