@@ -2,7 +2,6 @@ package altsrc
2
2
3
3
import (
4
4
"flag"
5
- "io/ioutil"
6
5
"os"
7
6
"testing"
8
7
@@ -12,7 +11,7 @@ import (
12
11
func TestCommandTomFileTest (t * testing.T ) {
13
12
app := & cli.App {}
14
13
set := flag .NewFlagSet ("test" , 0 )
15
- _ = ioutil .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
14
+ _ = os .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
16
15
defer os .Remove ("current.toml" )
17
16
test := []string {"test-cmd" , "--load" , "current.toml" }
18
17
_ = set .Parse (test )
@@ -42,7 +41,7 @@ func TestCommandTomFileTest(t *testing.T) {
42
41
func TestCommandTomlFileTestGlobalEnvVarWins (t * testing.T ) {
43
42
app := & cli.App {}
44
43
set := flag .NewFlagSet ("test" , 0 )
45
- _ = ioutil .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
44
+ _ = os .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
46
45
defer os .Remove ("current.toml" )
47
46
48
47
_ = os .Setenv ("THE_TEST" , "10" )
@@ -76,7 +75,7 @@ func TestCommandTomlFileTestGlobalEnvVarWins(t *testing.T) {
76
75
func TestCommandTomlFileTestGlobalEnvVarWinsNested (t * testing.T ) {
77
76
app := & cli.App {}
78
77
set := flag .NewFlagSet ("test" , 0 )
79
- _ = ioutil .WriteFile ("current.toml" , []byte ("[top]\n test = 15" ), 0666 )
78
+ _ = os .WriteFile ("current.toml" , []byte ("[top]\n test = 15" ), 0666 )
80
79
defer os .Remove ("current.toml" )
81
80
82
81
_ = os .Setenv ("THE_TEST" , "10" )
@@ -110,7 +109,7 @@ func TestCommandTomlFileTestGlobalEnvVarWinsNested(t *testing.T) {
110
109
func TestCommandTomlFileTestSpecifiedFlagWins (t * testing.T ) {
111
110
app := & cli.App {}
112
111
set := flag .NewFlagSet ("test" , 0 )
113
- _ = ioutil .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
112
+ _ = os .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
114
113
defer os .Remove ("current.toml" )
115
114
116
115
test := []string {"test-cmd" , "--load" , "current.toml" , "--test" , "7" }
@@ -142,7 +141,7 @@ func TestCommandTomlFileTestSpecifiedFlagWins(t *testing.T) {
142
141
func TestCommandTomlFileTestSpecifiedFlagWinsNested (t * testing.T ) {
143
142
app := & cli.App {}
144
143
set := flag .NewFlagSet ("test" , 0 )
145
- _ = ioutil .WriteFile ("current.toml" , []byte (`[top]
144
+ _ = os .WriteFile ("current.toml" , []byte (`[top]
146
145
test = 15` ), 0666 )
147
146
defer os .Remove ("current.toml" )
148
147
@@ -175,7 +174,7 @@ func TestCommandTomlFileTestSpecifiedFlagWinsNested(t *testing.T) {
175
174
func TestCommandTomlFileTestDefaultValueFileWins (t * testing.T ) {
176
175
app := & cli.App {}
177
176
set := flag .NewFlagSet ("test" , 0 )
178
- _ = ioutil .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
177
+ _ = os .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
179
178
defer os .Remove ("current.toml" )
180
179
181
180
test := []string {"test-cmd" , "--load" , "current.toml" }
@@ -207,7 +206,7 @@ func TestCommandTomlFileTestDefaultValueFileWins(t *testing.T) {
207
206
func TestCommandTomlFileTestDefaultValueFileWinsNested (t * testing.T ) {
208
207
app := & cli.App {}
209
208
set := flag .NewFlagSet ("test" , 0 )
210
- _ = ioutil .WriteFile ("current.toml" , []byte ("[top]\n test = 15" ), 0666 )
209
+ _ = os .WriteFile ("current.toml" , []byte ("[top]\n test = 15" ), 0666 )
211
210
defer os .Remove ("current.toml" )
212
211
213
212
test := []string {"test-cmd" , "--load" , "current.toml" }
@@ -239,7 +238,7 @@ func TestCommandTomlFileTestDefaultValueFileWinsNested(t *testing.T) {
239
238
func TestCommandTomlFileFlagHasDefaultGlobalEnvTomlSetGlobalEnvWins (t * testing.T ) {
240
239
app := & cli.App {}
241
240
set := flag .NewFlagSet ("test" , 0 )
242
- _ = ioutil .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
241
+ _ = os .WriteFile ("current.toml" , []byte ("test = 15" ), 0666 )
243
242
defer os .Remove ("current.toml" )
244
243
245
244
_ = os .Setenv ("THE_TEST" , "11" )
@@ -273,7 +272,7 @@ func TestCommandTomlFileFlagHasDefaultGlobalEnvTomlSetGlobalEnvWins(t *testing.T
273
272
func TestCommandTomlFileFlagHasDefaultGlobalEnvTomlSetGlobalEnvWinsNested (t * testing.T ) {
274
273
app := & cli.App {}
275
274
set := flag .NewFlagSet ("test" , 0 )
276
- _ = ioutil .WriteFile ("current.toml" , []byte ("[top]\n test = 15" ), 0666 )
275
+ _ = os .WriteFile ("current.toml" , []byte ("[top]\n test = 15" ), 0666 )
277
276
defer os .Remove ("current.toml" )
278
277
279
278
_ = os .Setenv ("THE_TEST" , "11" )
0 commit comments