| 1 |
This test verifies the remove of unused parameters in case of syntax errors. |
| 2 |
Issue golang/go#70268. |
| 3 |
|
| 4 |
-- go.mod -- |
| 5 |
module unused.mod |
| 6 |
|
| 7 |
go 1.21 |
| 8 |
|
| 9 |
-- a/a.go -- |
| 10 |
package a |
| 11 |
|
| 12 |
func A(x, unused int) int { //@codeaction("unused", "refactor.rewrite.removeUnusedParam", result=a) |
| 13 |
return x |
| 14 |
} |
| 15 |
|
| 16 |
-- @a/a/a.go -- |
| 17 |
package a |
| 18 |
|
| 19 |
func A(x int) int { //@codeaction("unused", "refactor.rewrite.removeUnusedParam", result=a) |
| 20 |
return x |
| 21 |
} |
| 22 |
|
| 23 |
-- b/b.go -- |
| 24 |
package b |
| 25 |
|
| 26 |
import "unused.mod/a" |
| 27 |
|
| 28 |
func main(){ |
| 29 |
a.A/*dsdd*/(/*cccc*/ 1, |
| 30 |
|
| 31 |
|
| 32 |
) //@diag(")", re"not enough arguments") |
| 33 |
} |