Debian Codegraph @

gopls/internal/test/marker/testdata/hover/genericmethods.txt

raw
1 This file tests for hovering over generic and instantiated methods and funcs.
2
3 -- flags --
4 -min_go=go1.27
5
6 -- settings.json --
7 {"analyses": {"unusedfunc": false}}
8
9 -- go.mod --
10 module example.com
11
12 go 1.27
13
14 -- a/a.go --
15 package a
16
17 type C[T any] struct{}
18
19 // This is method C.Method.
20 func (C[T]) Method[U any]() {} //@hover("Method", "Method", Methodgen)
21
22 var _ = C[string].Method[int] //@hover("Method", "Method", Methodint)
23
24 // This is func Func.
25 func Func[T any]() {} //@hover("Func", "Func", Funcgen)
26
27 var _ = Func[int] //@hover("Func", "Func", Funcint)
28
29 -- @Methodgen --
30 ```go
31 func (C[T]) Method[U any]()
32 ```
33
34 ---
35
36 This is method C.Method.
37
38
39 ---
40
41 [`(a.C).Method` on pkg.go.dev](https://pkg.go.dev/example.com/a#C.Method)
42 -- @Methodint --
43 ```go
44 func (C[string]).Method() // func[U any]()
45 ```
46
47 ---
48
49 This is method C.Method.
50
51
52 ---
53
54 [`(a.C).Method` on pkg.go.dev](https://pkg.go.dev/example.com/a#C.Method)
55 -- @Funcgen --
56 ```go
57 func Func[T any]()
58 ```
59
60 ---
61
62 This is func Func.
63
64
65 ---
66
67 [`a.Func` on pkg.go.dev](https://pkg.go.dev/example.com/a#Func)
68 -- @Funcint --
69 ```go
70 func Func() // func[T any]()
71 ```
72
73 ---
74
75 This is func Func.
76
77
78 ---
79
80 [`a.Func` on pkg.go.dev](https://pkg.go.dev/example.com/a#Func)