| 1 |
This test checks that the complete struct field is |
| 2 |
shown on hover (including struct tags and comments). |
| 3 |
|
| 4 |
-- go.mod -- |
| 5 |
module example.com |
| 6 |
|
| 7 |
-- lib/lib.go -- |
| 8 |
package lib |
| 9 |
|
| 10 |
type Something struct { |
| 11 |
// Field with a tag |
| 12 |
Field int `json:"field"` |
| 13 |
} |
| 14 |
|
| 15 |
func DoSomething() Something { |
| 16 |
var s Something |
| 17 |
s.Field = 42 //@hover("i", "Field", field) |
| 18 |
return s |
| 19 |
} |
| 20 |
|
| 21 |
-- @field -- |
| 22 |
```go |
| 23 |
field Field int `json:"field"` |
| 24 |
``` |
| 25 |
|
| 26 |
--- |
| 27 |
|
| 28 |
Field with a tag |
| 29 |
|
| 30 |
|
| 31 |
--- |
| 32 |
|
| 33 |
[`(lib.Something).Field` on pkg.go.dev](https://pkg.go.dev/example.com/lib#Something.Field) |