gopls/internal/test/marker/testdata/fixedbugs/issue74581.txt
raw| 1 | This test checks that gopls does not panic when requesting code actions |
| 2 | for an import that fails to resolve a package name (such as renaming "C"). |
| 3 | |
| 4 | -- flags -- |
| 5 | -cgo |
| 6 | |
| 7 | -- go.mod -- |
| 8 | module example.com |
| 9 | |
| 10 | go 1.18 |
| 11 | |
| 12 | -- a.go -- |
| 13 | package p //@ diag(re"^", re`cannot rename import "C"`), diag(re"^", re"go list failed") |
| 14 | |
| 15 | import . "C" //@ codeaction(".", "refactor.rewrite.eliminateDotImport", err="found 0 CodeActions"), diag(re`[.]`, re`cannot rename import "C"`) |
| 16 |