File tree Expand file tree Collapse file tree 6 files changed +5
-32
lines changed
Expand file tree Collapse file tree 6 files changed +5
-32
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ allowed:
8282 - httpCLF
8383 - ineffassign
8484 - infos
85+ - ioutil
8586 - ipam
8687 - istanbul
8788 - jose
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ package spoe
1818import (
1919 "bytes"
2020 "io"
21- "io/ioutil"
2221 "os"
2322 "path/filepath"
2423 "testing"
@@ -54,7 +53,7 @@ func Test_spoeclient_Create(t *testing.T) {
5453 name : "Should create a file with # _version prepended" ,
5554 clients : make (map [string ]* SingleSpoe ),
5655 fileName : "spoe.cfg" ,
57- readCloser : ioutil .NopCloser (bytes .NewReader ([]byte ("hello world" ))),
56+ readCloser : io .NopCloser (bytes .NewReader ([]byte ("hello world" ))),
5857 initParams : Params {
5958 SpoeDir : "/tmp" ,
6059 TransactionDir : "/tmp" ,
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ package storage
1818import (
1919 "bytes"
2020 "io"
21- "io/ioutil"
2221 "path/filepath"
2322 "reflect"
2423 "testing"
@@ -374,7 +373,7 @@ func Test_storage_Create(t *testing.T) {
374373 name : "Should create file if not exists" ,
375374 dirname : dirWithoutFile ,
376375 fileType : MapsType ,
377- readCloser : ioutil .NopCloser (bytes .NewReader ([]byte ("hello world" ))),
376+ readCloser : io .NopCloser (bytes .NewReader ([]byte ("hello world" ))),
378377 file : "newfile.map" ,
379378 want : filepath .Join (dirWithoutFile , "newfile.map" ),
380379 wantErr : false ,
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ package test
1717
1818import (
1919 "fmt"
20- "io/ioutil"
2120 "testing"
2221
2322 "github.com/google/go-cmp/cmp"
@@ -40,18 +39,6 @@ func tcpCheckExpectation() map[string]models.TCPChecks {
4039 return res
4140}
4241
43- func generateTCPCheckConfig (config string ) (string , error ) {
44- f , err := ioutil .TempFile ("/tmp" , "tcp_check" )
45- if err != nil {
46- return "" , err
47- }
48- err = prepareTestFile (config , f .Name ())
49- if err != nil {
50- return "" , err
51- }
52- return f .Name (), nil
53- }
54-
5542func (self Counter ) current () int64 {
5643 return self .count
5744}
Original file line number Diff line number Diff line change 1616package test
1717
1818import (
19- "io/ioutil"
2019 "testing"
2120
2221 "github.com/haproxytech/client-native/v6/models"
2322)
2423
25- func generateUserListConfig (config string ) (string , error ) {
26- f , err := ioutil .TempFile ("/tmp" , "userlist" )
27- if err != nil {
28- return "" , err
29- }
30- err = prepareTestFile (config , f .Name ())
31- if err != nil {
32- return "" , err
33- }
34- return f .Name (), nil
35- }
36-
3724func TestUserList (t * testing.T ) {
3825 config := `# _version=1
3926global
Original file line number Diff line number Diff line change 1616package test
1717
1818import (
19- "io/ioutil "
19+ "os "
2020 "testing"
2121
2222 "github.com/stretchr/testify/assert"
2323 "github.com/stretchr/testify/require"
2424)
2525
2626func generateConfig (config string ) (string , error ) {
27- f , err := ioutil . TempFile ("/tmp" , "version" )
27+ f , err := os . CreateTemp ("/tmp" , "version" )
2828 if err != nil {
2929 return "" , err
3030 }
You can’t perform that action at this time.
0 commit comments