github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/internal/lsp/testdata/godef/a/a.go.golden (about) 1 -- Lock-hoverdef -- 2 ```go 3 func (*sync.Mutex).Lock() 4 ``` 5 6 Lock locks m\. 7 8 [`(sync.Mutex).Lock` on pkg.go.dev](https://pkg.go.dev/sync?utm_source=gopls#Mutex.Lock) 9 -- Name-hoverdef -- 10 ```go 11 func (*types.object).Name() string 12 ``` 13 14 Name returns the object\'s \(package\-local, unqualified\) name\. 15 16 [`(types.TypeName).Name` on pkg.go.dev](https://pkg.go.dev/go/types?utm_source=gopls#TypeName.Name) 17 -- Random-definition -- 18 godef/a/random.go:3:6-12: defined here as ```go 19 func Random() int 20 ``` 21 22 [`a.Random` on pkg.go.dev](https://pkg.go.dev/github.com/powerman/golang-tools/internal/lsp/godef/a?utm_source=gopls#Random) 23 -- Random-definition-json -- 24 { 25 "span": { 26 "uri": "file://godef/a/random.go", 27 "start": { 28 "line": 3, 29 "column": 6, 30 "offset": 16 31 }, 32 "end": { 33 "line": 3, 34 "column": 12, 35 "offset": 22 36 } 37 }, 38 "description": "```go\nfunc Random() int\n```\n\n[`a.Random` on pkg.go.dev](https://pkg.go.dev/github.com/powerman/golang-tools/internal/lsp/godef/a?utm_source=gopls#Random)" 39 } 40 41 -- Random-hoverdef -- 42 ```go 43 func Random() int 44 ``` 45 46 [`a.Random` on pkg.go.dev](https://pkg.go.dev/github.com/powerman/golang-tools/internal/lsp/godef/a?utm_source=gopls#Random) 47 -- Random2-definition -- 48 godef/a/random.go:8:6-13: defined here as ```go 49 func Random2(y int) int 50 ``` 51 52 [`a.Random2` on pkg.go.dev](https://pkg.go.dev/github.com/powerman/golang-tools/internal/lsp/godef/a?utm_source=gopls#Random2) 53 -- Random2-definition-json -- 54 { 55 "span": { 56 "uri": "file://godef/a/random.go", 57 "start": { 58 "line": 8, 59 "column": 6, 60 "offset": 71 61 }, 62 "end": { 63 "line": 8, 64 "column": 13, 65 "offset": 78 66 } 67 }, 68 "description": "```go\nfunc Random2(y int) int\n```\n\n[`a.Random2` on pkg.go.dev](https://pkg.go.dev/github.com/powerman/golang-tools/internal/lsp/godef/a?utm_source=gopls#Random2)" 69 } 70 71 -- Random2-hoverdef -- 72 ```go 73 func Random2(y int) int 74 ``` 75 76 [`a.Random2` on pkg.go.dev](https://pkg.go.dev/github.com/powerman/golang-tools/internal/lsp/godef/a?utm_source=gopls#Random2) 77 -- aPackage-hoverdef -- 78 Package a is a package for testing go to definition\. 79 -- declBlockA-hoverdef -- 80 ```go 81 type a struct { 82 x string 83 } 84 ``` 85 86 1st type declaration block 87 -- declBlockB-hoverdef -- 88 ```go 89 type b struct{} 90 ``` 91 92 b has a comment 93 -- declBlockC-hoverdef -- 94 ```go 95 type c struct { 96 f string 97 } 98 ``` 99 100 c is a struct 101 -- declBlockD-hoverdef -- 102 ```go 103 type d string 104 ``` 105 106 3rd type declaration block 107 -- declBlockE-hoverdef -- 108 ```go 109 type e struct { 110 f float64 111 } 112 ``` 113 114 e has a comment 115 -- err-definition -- 116 godef/a/a.go:33:6-9: defined here as ```go 117 var err error 118 ``` 119 120 \@err 121 -- err-definition-json -- 122 { 123 "span": { 124 "uri": "file://godef/a/a.go", 125 "start": { 126 "line": 33, 127 "column": 6, 128 "offset": 612 129 }, 130 "end": { 131 "line": 33, 132 "column": 9, 133 "offset": 615 134 } 135 }, 136 "description": "```go\nvar err error\n```\n\n\\@err" 137 } 138 139 -- err-hoverdef -- 140 ```go 141 var err error 142 ``` 143 144 \@err 145 -- g-hoverdef -- 146 ```go 147 const g untyped int = 1 148 ``` 149 150 When I hover on g, I should see this comment\. 151 -- h-hoverdef -- 152 ```go 153 const h untyped int = 2 154 ``` 155 156 Constant block\. 157 -- make-hoverdef -- 158 ```go 159 func make(t Type, size ...int) Type 160 ``` 161 162 The make built\-in function allocates and initializes an object of type slice, map, or chan \(only\)\. 163 164 [`make` on pkg.go.dev](https://pkg.go.dev/builtin?utm_source=gopls#make) 165 -- string-hoverdef -- 166 ```go 167 type string string 168 ``` 169 170 string is the set of all strings of 8\-bit bytes, conventionally but not necessarily representing UTF\-8\-encoded text\. 171 172 [`string` on pkg.go.dev](https://pkg.go.dev/builtin?utm_source=gopls#string) 173 -- typesImport-hoverdef -- 174 ```go 175 package types ("go/types") 176 ``` 177 178 [`types` on pkg.go.dev](https://pkg.go.dev/go/types?utm_source=gopls) 179 -- x-hoverdef -- 180 ```go 181 var x string 182 ``` 183 184 x is a variable\. 185 -- z-hoverdef -- 186 ```go 187 var z string 188 ``` 189 190 z is a variable too\.