12
12
)
13
13
14
14
func testsetup () {
15
- os .MkdirTemp ("a" , "b" ) // if -all = true, want "os\\.MkdirTemp\\(\\) can be replaced by `testing\\.TempDir\\(\\)` in testsetup"
16
- _ , err := os .MkdirTemp ("a" , "b" ) // if -all = true, want "os\\.MkdirTemp\\(\\) can be replaced by `testing\\.TempDir\\(\\)` in testsetup"
15
+ os .MkdirTemp ("a" , "b" ) // if -all = true, want "os\\.MkdirTemp\\(\\) should be replaced by `testing\\.TempDir\\(\\)` in testsetup"
16
+ _ , err := os .MkdirTemp ("a" , "b" ) // if -all = true, want "os\\.MkdirTemp\\(\\) should be replaced by `testing\\.TempDir\\(\\)` in testsetup"
17
17
if err != nil {
18
18
_ = err
19
19
}
@@ -22,49 +22,49 @@ func testsetup() {
22
22
23
23
func TestF (t * testing.T ) {
24
24
testsetup ()
25
- os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `t\\.TempDir\\(\\)` in TestF"
26
- _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `t\\.TempDir\\(\\)` in TestF"
25
+ os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `t\\.TempDir\\(\\)` in TestF"
26
+ _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `t\\.TempDir\\(\\)` in TestF"
27
27
_ = err
28
- if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) can be replaced by `t\\.TempDir\\(\\)` in TestF"
28
+ if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) should be replaced by `t\\.TempDir\\(\\)` in TestF"
29
29
_ = err
30
30
}
31
31
}
32
32
33
33
func BenchmarkF (b * testing.B ) {
34
34
TB (b )
35
- os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `b\\.TempDir\\(\\)` in BenchmarkF"
36
- _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `b\\.TempDir\\(\\)` in BenchmarkF"
35
+ os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `b\\.TempDir\\(\\)` in BenchmarkF"
36
+ _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `b\\.TempDir\\(\\)` in BenchmarkF"
37
37
_ = err
38
- if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) can be replaced by `b\\.TempDir\\(\\)` in BenchmarkF"
38
+ if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) should be replaced by `b\\.TempDir\\(\\)` in BenchmarkF"
39
39
_ = err
40
40
}
41
41
}
42
42
43
43
func TB (tb testing.TB ) {
44
- os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `tb\\.TempDir\\(\\)` in TB"
45
- _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `tb\\.TempDir\\(\\)` in TB"
44
+ os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `tb\\.TempDir\\(\\)` in TB"
45
+ _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `tb\\.TempDir\\(\\)` in TB"
46
46
_ = err
47
- if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) can be replaced by `tb\\.TempDir\\(\\)` in TB"
47
+ if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) should be replaced by `tb\\.TempDir\\(\\)` in TB"
48
48
_ = err
49
49
}
50
50
}
51
51
52
52
func FuzzF (f * testing.F ) {
53
- os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `f\\.TempDir\\(\\)` in FuzzF"
54
- _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `f\\.TempDir\\(\\)` in FuzzF"
53
+ os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `f\\.TempDir\\(\\)` in FuzzF"
54
+ _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `f\\.TempDir\\(\\)` in FuzzF"
55
55
_ = err
56
- if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) can be replaced by `f\\.TempDir\\(\\)` in FuzzF"
56
+ if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) should be replaced by `f\\.TempDir\\(\\)` in FuzzF"
57
57
_ = err
58
58
}
59
59
}
60
60
61
61
func TestFunctionLiteral (t * testing.T ) {
62
62
testsetup ()
63
63
t .Run ("test" , func (t * testing.T ) {
64
- os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `t\\.TempDir\\(\\)` in anonymous function"
65
- _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) can be replaced by `t\\.TempDir\\(\\)` in anonymous function"
64
+ os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `t\\.TempDir\\(\\)` in anonymous function"
65
+ _ , err := os .MkdirTemp ("a" , "b" ) // want "os\\.MkdirTemp\\(\\) should be replaced by `t\\.TempDir\\(\\)` in anonymous function"
66
66
_ = err
67
- if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) can be replaced by `t\\.TempDir\\(\\)` in anonymous function"
67
+ if _ , err := os .MkdirTemp ("a" , "b" ); err != nil { // want "os\\.MkdirTemp\\(\\) should be replaced by `t\\.TempDir\\(\\)` in anonymous function"
68
68
_ = err
69
69
}
70
70
})
0 commit comments