All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 ===============================================================================
2 ALE Go Integration *ale-go-options*
5 ===============================================================================
6 Integration Information
8 ALE enables `gofmt`, `gopls` and `go vet` by default. It also supports `staticcheck`,
9 `go build, ``gosimple`, `golangserver`, and `golangci-lint.
11 To enable `golangci-lint`, update |g:ale_linters| as appropriate.
12 A possible configuration is to enable golangci-lint and `gofmt:
14 " Enable all of the linters you want for Go.
15 let g:ale_linters = {'go': ['golangci-lint', 'gofmt']}
17 *ale-options.go_go_executable*
18 *g:ale_go_go_executable*
19 *b:ale_go_go_executable*
21 g:ale_go_go_executable
25 The executable that will be run for the `gobuild` and `govet` linters, and
28 *ale-options.go_go111module*
29 *g:ale_go_go111module*
30 *b:ale_go_go111module*
36 Override the value of the `$GO111MODULE` environment variable for
40 ===============================================================================
43 *ale-options.go_bingo_executable*
44 *g:ale_go_bingo_executable*
45 *b:ale_go_bingo_executable*
47 g:ale_go_bingo_executable
51 Location of the bingo binary file.
53 *ale-options.go_bingo_options*
54 *g:ale_go_bingo_options*
55 *b:ale_go_bingo_options*
57 g:ale_go_bingo_options
62 ===============================================================================
63 cspell *ale-go-cspell*
65 See |ale-cspell-options|
68 ===============================================================================
69 gobuild *ale-go-gobuild*
71 *ale-options.go_gobuild_options*
72 *g:ale_go_gobuild_options*
73 *b:ale_go_gobuild_options*
75 g:ale_go_gobuild_options
79 This variable can be set to pass additional options to the gobuild linter.
80 They are injected directly after "go test".
83 ===============================================================================
86 *ale-options.go_gofmt_options*
87 *g:ale_go_gofmt_options*
88 *b:ale_go_gofmt_options*
90 g:ale_go_gofmt_options
94 This variable can be set to pass additional options to the gofmt fixer.
97 ===============================================================================
98 gofumpt *ale-go-gofumpt*
100 *ale-options.go_gofumpt_executable*
101 *g:ale_go_gofumpt_executable*
102 *b:ale_go_gofumpt_executable*
103 go_gofumpt_executable
104 g:ale_go_gofumpt_executable
108 Executable to run to use as the gofumpt fixer.
110 *ale-options.go_gofumpt_options*
111 *g:ale_go_gofumpt_options*
112 *b:ale_go_gofumpt_options*
114 g:ale_go_gofumpt_options
118 Options to pass to the gofumpt fixer.
121 ===============================================================================
122 golangci-lint *ale-go-golangci-lint*
124 `golangci-lint` is a `lint_file` linter, which only lints files that are
125 written to disk. This differs from the default behavior of linting the buffer.
128 *ale-options.go_golangci_lint_executable*
129 *g:ale_go_golangci_lint_executable*
130 *b:ale_go_golangci_lint_executable*
131 go_golangci_lint_executable
132 g:ale_go_golangci_lint_executable
134 Default: `'golangci-lint'`
136 The executable that will be run for golangci-lint.
138 *ale-options.go_golangci_lint_options*
139 *g:ale_go_golangci_lint_options*
140 *b:ale_go_golangci_lint_options*
141 go_golangci_lint_options
142 g:ale_go_golangci_lint_options
146 This variable can be changed to alter the command-line arguments to the
147 golangci-lint invocation.
149 *ale-options.go_golangci_lint_package*
150 *g:ale_go_golangci_lint_package*
151 *b:ale_go_golangci_lint_package*
152 go_golangci_lint_package
153 g:ale_go_golangci_lint_package
157 When set to `1`, the whole Go package will be checked instead of only the
161 ===============================================================================
162 golangserver *ale-go-golangserver*
164 *ale-options.go_langserver_executable*
165 *g:ale_go_langserver_executable*
166 *b:ale_go_langserver_executable*
167 go_langserver_executable
168 g:ale_go_langserver_executable
170 Default: `'go-langserver'`
172 Location of the go-langserver binary file.
174 *ale-options.go_langserver_options*
175 *g:ale_go_langserver_options*
176 *b:ale_go_langserver_options*
177 go_langserver_options
178 g:ale_go_langserver_options
182 Additional options passed to the go-langserver command. Note that the
183 `-gocodecompletion` option is ignored because it is handled automatically
184 by the |g:ale_completion_enabled| variable.
187 ===============================================================================
188 golines *ale-go-golines*
190 *ale-options.go_golines_executable*
191 *g:ale_go_golines_executable*
192 *b:ale_go_lines_executable*
193 go_golines_executable
194 g:ale_go_golines_executable
198 Location of the golines binary file
200 *ale-options.go_golines_options*
201 *g:ale_go_golines_options*
202 *b:ale_go_golines_options*
204 g:ale_go_golines_options
208 Additional options passed to the golines command. By default golines has
209 --max-length=100 (lines above 100 characters will be wrapped)
212 ===============================================================================
215 gopls is the official Go language server, and is enabled for use with ALE by
218 To install the latest stable version of `gopls` to your `$GOPATH`, try the
221 GO111MODULE=on go get golang.org/x/tools/gopls@latest
223 If `$GOPATH` is readable by ALE, it should probably work without you having to
224 do anything else. See the `gopls` README file for more information:
226 https://github.com/golang/tools/blob/master/gopls/README.md
229 -------------------------------------------------------------------------------
231 *ale-options.go_gopls_executable*
232 *g:ale_go_gopls_executable*
233 *b:ale_go_gopls_executable*
235 g:ale_go_gopls_executable
239 See |ale-integrations-local-executables|
241 ALE will search for `gopls` in locally installed directories first by
242 default, and fall back on a globally installed `gopls` if it can't be found
245 *ale-options.go_gopls_options*
246 *g:ale_go_gopls_options*
247 *b:ale_go_gopls_options*
249 g:ale_go_gopls_options
253 Command-line options passed to the gopls executable. See `gopls -h`.
255 *ale-options.go_gopls_fix_executable*
256 *g:ale_go_gopls_fix_executable*
257 *b:ale_go_gopls_fix_executable*
258 go_gopls_fix_executable
259 g:ale_go_gopls_fix_executable
263 Executable to run to use as the gopls fixer.
265 *ale-options.go_gopls_fix_options*
266 *g:ale_go_gopls_fix_options*
267 *b:ale_go_gopls_fix_options*
269 g:ale_go_gopls_fix_options
273 Options to pass to the gopls fixer.
275 *ale-options.go_gopls_init_options*
276 *g:ale_go_gopls_init_options*
277 *b:ale_go_gopls_init_options*
278 go_gopls_init_options
279 g:ale_go_gopls_init_options
283 LSP initialization options passed to gopls. This can be used to configure
284 the behaviour of gopls.
287 let g:ale_go_gopls_init_options = {
288 \ 'ui.diagnostic.analyses': {
289 \ 'composites': v:false,
290 \ 'unusedparams': v:true,
291 \ 'unusedresult': v:true,
295 For a full list of supported analyzers, see:
296 https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md
298 *ale-options.go_gopls_use_global*
299 *g:ale_go_gopls_use_global*
300 *b:ale_go_gopls_use_global*
302 g:ale_go_gopls_use_global
304 Default: `get(g:, 'ale_use_global_executables', 0)`
306 See |ale-integrations-local-executables|
309 ===============================================================================
312 *ale-options.go_govet_options*
313 *g:ale_go_govet_options*
314 *b:ale_go_govet_options*
316 g:ale_go_govet_options
320 This variable can be set to pass additional options to the go vet linter.
323 ===============================================================================
324 revive *ale-go-revive*
326 *ale-options.go_revive_executable*
327 *g:ale_go_revive_executable*
328 *b:ale_go_revive_executable*
330 g:ale_go_revive_executable
334 This variable can be set to change the revive executable path.
336 *ale-options.go_revive_options*
337 *g:ale_go_revive_options*
338 *b:ale_go_revive_options*
340 g:ale_go_revive_options
344 This variable can be set to pass additional options to the revive
347 ===============================================================================
348 staticcheck *ale-go-staticcheck*
350 *ale-options.go_staticcheck_executable*
351 *g:ale_go_staticcheck_executable*
352 *b:ale_go_staticcheck_executable*
353 go_staticcheck_executable
354 g:ale_go_staticcheck_executable
356 Default: `'staticcheck'`
358 See |ale-integrations-local-executables|
360 ALE will search for `staticcheck` in locally installed directories first by
361 default, and fall back on a globally installed `staticcheck` if it can't be
364 *ale-options.go_staticcheck_options*
365 *g:ale_go_staticcheck_options*
366 *b:ale_go_staticcheck_options*
367 go_staticcheck_options
368 g:ale_go_staticcheck_options
372 This variable can be set to pass additional options to the staticcheck
375 *ale-options.go_staticcheck_lint_package*
376 *g:ale_go_staticcheck_lint_package*
377 *b:ale_go_staticcheck_lint_package*
378 go_staticcheck_lint_package
379 g:ale_go_staticcheck_lint_package
383 When set to `1`, the whole Go package will be checked instead of only the
386 *ale-options.go_staticcheck_use_global*
387 *g:ale_go_staticcheck_use_global*
388 *b:ale_go_staticcheck_use_global*
389 go_staticcheck_use_global
390 g:ale_go_staticcheck_use_global
392 Default: `get(g:, 'ale_use_global_executables', 0)`
394 See |ale-integrations-local-executables|
397 ===============================================================================
398 vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: