File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ package test
33import (
44 "bufio"
55 "fmt"
6- "io/ioutil"
76 "os"
87 "os/exec"
8+ "path"
99 "path/filepath"
1010 "strings"
1111 "testing"
@@ -134,12 +134,7 @@ func TestStderrOutput(t *testing.T) {
134134}
135135
136136func TestFileOutput (t * testing.T ) {
137- f , err := os .CreateTemp ("" , "golangci_lint_test_result" )
138- require .NoError (t , err )
139- f .Close ()
140-
141- resultPath := f .Name ()
142- defer os .Remove (resultPath )
137+ resultPath := path .Join (t .TempDir (), "golangci_lint_test_result" )
143138
144139 sourcePath := filepath .Join (testdataDir , "gci" , "gci.go" )
145140 args := []string {
@@ -157,7 +152,7 @@ func TestFileOutput(t *testing.T) {
157152 ExpectHasIssue ("testdata/gci/gci.go:7: File is not `gci`-ed" ).
158153 ExpectOutputNotContains (`"Issues":[` )
159154
160- b , err := ioutil .ReadFile (resultPath )
155+ b , err := os .ReadFile (resultPath )
161156 require .NoError (t , err )
162157 require .Contains (t , string (b ), `"Issues":[` )
163158}
You can’t perform that action at this time.
0 commit comments