gopls/internal/test/marker/testdata/quickfix/stubmethods/anoniface.txt
raw| 1 | Test stubbing a method of an anonymous interface. |
| 2 | |
| 3 | -- go.mod -- |
| 4 | module example.com |
| 5 | |
| 6 | go 1.18 |
| 7 | |
| 8 | -- a/a.go -- |
| 9 | package a |
| 10 | |
| 11 | var _ interface{ f(int) } = C(0) //@quickfix(re"C", re"missing method", out) |
| 12 | |
| 13 | type C int |
| 14 | |
| 15 | -- @out/a/a.go -- |
| 16 | @@ -7 +7,4 @@ |
| 17 | +// f implements an anonymous interface. |
| 18 | +func (c C) f(int) { |
| 19 | + panic("unimplemented") |
| 20 | +} |