Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / internal / lsp / testdata / godef / a / a.go
1 // Package a is a package for testing go to definition.
2 package a //@mark(aPackage, "a "),hover("a ", aPackage)
3
4 import (
5         "fmt"
6         "go/types"
7         "sync"
8 )
9
10 var (
11         // x is a variable.
12         x string //@x,hover("x", x)
13 )
14
15 // Constant block. When I hover on h, I should see this comment.
16 const (
17         // When I hover on g, I should see this comment.
18         g = 1 //@g,hover("g", g)
19
20         h = 2 //@h,hover("h", h)
21 )
22
23 // z is a variable too.
24 var z string //@z,hover("z", z)
25
26 type A string //@mark(AString, "A")
27
28 func AStuff() { //@AStuff
29         x := 5
30         Random2(x) //@godef("dom2", Random2)
31         Random()   //@godef("()", Random)
32
33         var err error         //@err
34         fmt.Printf("%v", err) //@godef("err", err)
35
36         var y string       //@string,hover("string", string)
37         _ = make([]int, 0) //@make,hover("make", make)
38
39         var mu sync.Mutex
40         mu.Lock() //@Lock,hover("Lock", Lock)
41
42         var typ *types.Named //@mark(typesImport, "types"),hover("types", typesImport)
43         typ.Obj().Name()     //@Name,hover("Name", Name)
44 }
45
46 type A struct {
47 }
48
49 func (_ A) Hi() {} //@mark(AHi, "Hi")
50
51 type S struct {
52         Field int //@mark(AField, "Field")
53         R         // embed a struct
54         H         // embed an interface
55 }
56
57 type R struct {
58         Field2 int //@mark(AField2, "Field2")
59 }
60
61 func (_ R) Hey() {} //@mark(AHey, "Hey")
62
63 type H interface {
64         Goodbye() //@mark(AGoodbye, "Goodbye")
65 }
66
67 type I interface {
68         B() //@mark(AB, "B")
69         J
70 }
71
72 type J interface {
73         Hello() //@mark(AHello, "Hello")
74 }