File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ package test
3
3
import (
4
4
"bufio"
5
5
"fmt"
6
- "io/ioutil"
7
6
"os"
8
7
"os/exec"
8
+ "path"
9
9
"path/filepath"
10
10
"strings"
11
11
"testing"
@@ -134,12 +134,7 @@ func TestStderrOutput(t *testing.T) {
134
134
}
135
135
136
136
func 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" )
143
138
144
139
sourcePath := filepath .Join (testdataDir , "gci" , "gci.go" )
145
140
args := []string {
@@ -157,7 +152,7 @@ func TestFileOutput(t *testing.T) {
157
152
ExpectHasIssue ("testdata/gci/gci.go:7: File is not `gci`-ed" ).
158
153
ExpectOutputNotContains (`"Issues":[` )
159
154
160
- b , err := ioutil .ReadFile (resultPath )
155
+ b , err := os .ReadFile (resultPath )
161
156
require .NoError (t , err )
162
157
require .Contains (t , string (b ), `"Issues":[` )
163
158
}
You can’t perform that action at this time.
0 commit comments