4
4
"bytes"
5
5
"fmt"
6
6
"io"
7
- "io/ioutil "
7
+ "os "
8
8
"reflect"
9
9
"strings"
10
10
@@ -27,13 +27,13 @@ func loadArgsFileContent(cmd *Command, cmdArgs interface{}) error {
27
27
for _ , v := range fieldValues {
28
28
switch i := v .Interface ().(type ) {
29
29
case io.Reader :
30
- b , err := ioutil .ReadAll (i )
30
+ b , err := io .ReadAll (i )
31
31
if err != nil {
32
32
return fmt .Errorf ("could not read argument: %s" , err )
33
33
}
34
34
35
35
if strings .HasPrefix (string (b ), "@" ) {
36
- content , err := ioutil .ReadFile (string (b )[1 :])
36
+ content , err := os .ReadFile (string (b )[1 :])
37
37
if err != nil {
38
38
return fmt .Errorf ("could not open requested file: %s" , err )
39
39
}
@@ -42,15 +42,15 @@ func loadArgsFileContent(cmd *Command, cmdArgs interface{}) error {
42
42
}
43
43
case * string :
44
44
if strings .HasPrefix (* i , "@" ) {
45
- content , err := ioutil .ReadFile ((* i )[1 :])
45
+ content , err := os .ReadFile ((* i )[1 :])
46
46
if err != nil {
47
47
return fmt .Errorf ("could not open requested file: %s" , err )
48
48
}
49
49
v .SetString (string (content ))
50
50
}
51
51
case string :
52
52
if strings .HasPrefix (i , "@" ) {
53
- content , err := ioutil .ReadFile (i [1 :])
53
+ content , err := os .ReadFile (i [1 :])
54
54
if err != nil {
55
55
return fmt .Errorf ("could not open requested file: %s" , err )
56
56
}
0 commit comments