2017-04-13 09:27:09 +00:00
|
|
|
===============================================================================
|
2017-07-06 23:10:30 +00:00
|
|
|
ALE Go Integration *ale-go-options*
|
2017-04-13 09:27:09 +00:00
|
|
|
|
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2017-04-15 20:04:43 +00:00
|
|
|
Integration Information
|
|
|
|
|
2023-07-24 12:33:15 +00:00
|
|
|
ALE enables `gofmt`, `gopls` and `go vet` by default. It also supports `staticcheck`,
|
|
|
|
`go build, ``gosimple`, `golangserver`, and `golangci-lint.
|
2017-05-30 12:39:22 +00:00
|
|
|
|
2023-07-24 12:33:15 +00:00
|
|
|
To enable `golangci-lint`, update |g:ale_linters| as appropriate.
|
|
|
|
A possible configuration is to enable golangci-lint and `gofmt:
|
2017-04-15 20:04:43 +00:00
|
|
|
>
|
|
|
|
" Enable all of the linters you want for Go.
|
2023-07-24 12:33:15 +00:00
|
|
|
let g:ale_linters = {'go': ['golangci-lint', 'gofmt']}
|
2017-04-15 20:04:43 +00:00
|
|
|
<
|
|
|
|
|
2021-05-27 21:03:39 +00:00
|
|
|
g:ale_go_go_executable *g:ale_go_go_executable*
|
|
|
|
*b:ale_go_go_executable*
|
2018-09-19 18:33:23 +00:00
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `'go'`
|
|
|
|
|
|
|
|
The executable that will be run for the `gobuild` and `govet` linters, and
|
2018-10-07 02:19:22 +00:00
|
|
|
the `gomod` fixer.
|
2018-09-19 18:33:23 +00:00
|
|
|
|
2019-08-02 08:09:10 +00:00
|
|
|
|
2019-04-11 02:25:06 +00:00
|
|
|
g:ale_go_go111module *g:ale_go_go111module*
|
|
|
|
*b:ale_go_go111module*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
Override the value of the `$GO111MODULE` environment variable for
|
|
|
|
golang tools.
|
|
|
|
|
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
===============================================================================
|
|
|
|
bingo *ale-go-bingo*
|
|
|
|
|
|
|
|
g:ale_go_bingo_executable *g:ale_go_bingo_executable*
|
|
|
|
*b:ale_go_bingo_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'bingo'`
|
|
|
|
|
|
|
|
Location of the bingo binary file.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_bingo_options *g:ale_go_bingo_options*
|
|
|
|
*b:ale_go_bingo_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
|
2021-11-18 22:41:05 +00:00
|
|
|
===============================================================================
|
|
|
|
cspell *ale-go-cspell*
|
|
|
|
|
|
|
|
See |ale-cspell-options|
|
|
|
|
|
2018-02-04 13:55:09 +00:00
|
|
|
===============================================================================
|
|
|
|
gobuild *ale-go-gobuild*
|
|
|
|
|
|
|
|
g:ale_go_gobuild_options *g:ale_go_gobuild_options*
|
|
|
|
*b:ale_go_gobuild_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options to the gobuild linter.
|
|
|
|
They are injected directly after "go test".
|
|
|
|
|
|
|
|
|
2017-10-03 17:54:35 +00:00
|
|
|
===============================================================================
|
|
|
|
gofmt *ale-go-gofmt*
|
|
|
|
|
|
|
|
g:ale_go_gofmt_options *g:ale_go_gofmt_options*
|
|
|
|
*b:ale_go_gofmt_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options to the gofmt fixer.
|
|
|
|
|
2018-02-15 11:23:36 +00:00
|
|
|
|
2021-11-09 07:53:44 +00:00
|
|
|
===============================================================================
|
|
|
|
gofumpt *ale-go-gofumpt*
|
|
|
|
|
|
|
|
g:ale_go_gofumpt_executable *g:ale_go_gofumpt_executable*
|
|
|
|
*b:ale_go_gofumpt_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'gofumpt'`
|
|
|
|
|
|
|
|
Executable to run to use as the gofumpt fixer.
|
|
|
|
|
|
|
|
g:ale_go_gofumpt_options *g:ale_go_gofumpt_options*
|
|
|
|
*b:ale_go_gofumpt_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
Options to pass to the gofumpt fixer.
|
|
|
|
|
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
===============================================================================
|
|
|
|
golangci-lint *ale-go-golangci-lint*
|
|
|
|
|
|
|
|
`golangci-lint` is a `lint_file` linter, which only lints files that are
|
|
|
|
written to disk. This differs from the default behavior of linting the buffer.
|
|
|
|
See: |ale-lint-file|
|
|
|
|
|
|
|
|
g:ale_go_golangci_lint_executable *g:ale_go_golangci_lint_executable*
|
|
|
|
*b:ale_go_golangci_lint_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'golangci-lint'`
|
|
|
|
|
|
|
|
The executable that will be run for golangci-lint.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_golangci_lint_options *g:ale_go_golangci_lint_options*
|
|
|
|
*b:ale_go_golangci_lint_options*
|
|
|
|
Type: |String|
|
2023-04-02 09:09:58 +00:00
|
|
|
Default: `''`
|
2019-04-10 18:23:06 +00:00
|
|
|
|
|
|
|
This variable can be changed to alter the command-line arguments to the
|
|
|
|
golangci-lint invocation.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_golangci_lint_package *g:ale_go_golangci_lint_package*
|
|
|
|
*b:ale_go_golangci_lint_package*
|
|
|
|
Type: |Number|
|
|
|
|
Default: `0`
|
|
|
|
|
|
|
|
When set to `1`, the whole Go package will be checked instead of only the
|
|
|
|
current file.
|
|
|
|
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
golangserver *ale-go-golangserver*
|
|
|
|
|
|
|
|
g:ale_go_langserver_executable *g:ale_go_langserver_executable*
|
|
|
|
*b:ale_go_langserver_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'go-langserver'`
|
|
|
|
|
|
|
|
Location of the go-langserver binary file.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_langserver_options *g:ale_go_langserver_options*
|
|
|
|
*b:ale_go_langserver_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
Additional options passed to the go-langserver command. Note that the
|
|
|
|
`-gocodecompletion` option is ignored because it is handled automatically
|
|
|
|
by the |g:ale_completion_enabled| variable.
|
|
|
|
|
2021-11-18 22:41:05 +00:00
|
|
|
|
2021-08-09 01:13:43 +00:00
|
|
|
===============================================================================
|
|
|
|
golines *ale-go-golines*
|
|
|
|
|
|
|
|
g:ale_go_golines_executable *g:ale_go_lines_executable*
|
|
|
|
*b:ale_go_lines_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'golines'`
|
|
|
|
|
|
|
|
Location of the golines binary file
|
|
|
|
|
|
|
|
g:ale_go_golines_options *g:ale_go_golines_options*
|
|
|
|
*b:ale_go_golines_options*
|
|
|
|
Type: |String|
|
2022-10-29 11:56:47 +00:00
|
|
|
Default: `''`
|
2021-08-09 01:13:43 +00:00
|
|
|
|
2021-11-09 07:53:44 +00:00
|
|
|
Additional options passed to the golines command. By default golines has
|
2021-08-09 01:13:43 +00:00
|
|
|
--max-length=100 (lines above 100 characters will be wrapped)
|
2019-04-10 18:23:06 +00:00
|
|
|
|
2021-11-18 22:41:05 +00:00
|
|
|
|
2018-02-15 11:23:36 +00:00
|
|
|
===============================================================================
|
2019-04-10 18:23:06 +00:00
|
|
|
gopls *ale-go-gopls*
|
2018-02-15 11:23:36 +00:00
|
|
|
|
2021-05-26 21:43:30 +00:00
|
|
|
gopls is the official Go language server, and is enabled for use with ALE by
|
|
|
|
default.
|
|
|
|
|
|
|
|
To install the latest stable version of `gopls` to your `$GOPATH`, try the
|
|
|
|
following command: >
|
|
|
|
|
|
|
|
GO111MODULE=on go get golang.org/x/tools/gopls@latest
|
|
|
|
<
|
|
|
|
If `$GOPATH` is readable by ALE, it should probably work without you having to
|
|
|
|
do anything else. See the `gopls` README file for more information:
|
|
|
|
|
|
|
|
https://github.com/golang/tools/blob/master/gopls/README.md
|
|
|
|
|
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
g:ale_go_gopls_executable *g:ale_go_gopls_executable*
|
|
|
|
*b:ale_go_gopls_executable*
|
2018-02-15 11:23:36 +00:00
|
|
|
Type: |String|
|
2019-04-10 18:23:06 +00:00
|
|
|
Default: `'gopls'`
|
2018-02-15 11:23:36 +00:00
|
|
|
|
2021-05-26 21:43:30 +00:00
|
|
|
See |ale-integrations-local-executables|
|
|
|
|
|
|
|
|
ALE will search for `gopls` in locally installed directories first by
|
|
|
|
default, and fall back on a globally installed `gopls` if it can't be found
|
|
|
|
otherwise.
|
2018-02-15 11:23:36 +00:00
|
|
|
|
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
g:ale_go_gopls_options *g:ale_go_gopls_options*
|
|
|
|
*b:ale_go_gopls_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
2018-02-15 11:23:36 +00:00
|
|
|
|
2021-02-03 13:49:27 +00:00
|
|
|
Command-line options passed to the gopls executable. See `gopls -h`.
|
|
|
|
|
|
|
|
|
2023-01-28 07:20:29 +00:00
|
|
|
g:ale_go_gopls_fix_executable *g:ale_go_gopls_fix_executable*
|
|
|
|
*b:ale_go_gopls_fix_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'gopls'`
|
|
|
|
|
|
|
|
Executable to run to use as the gopls fixer.
|
|
|
|
|
|
|
|
g:ale_go_gopls_fix_options *g:ale_go_gopls_fix_options*
|
|
|
|
*b:ale_go_gopls_fix_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
Options to pass to the gopls fixer.
|
|
|
|
|
|
|
|
|
2021-02-03 13:49:27 +00:00
|
|
|
g:ale_go_gopls_init_options *g:ale_go_gopls_init_options*
|
|
|
|
*b:ale_go_gopls_init_options*
|
|
|
|
Type: |Dictionary|
|
|
|
|
Default: `{}`
|
|
|
|
|
|
|
|
LSP initialization options passed to gopls. This can be used to configure
|
|
|
|
the behaviour of gopls.
|
|
|
|
|
|
|
|
Example: >
|
|
|
|
let g:ale_go_gopls_init_options = {'ui.diagnostic.analyses': {
|
|
|
|
\ 'composites': v:false,
|
|
|
|
\ 'unusedparams': v:true,
|
|
|
|
\ 'unusedresult': v:true,
|
|
|
|
\ }}
|
|
|
|
<
|
|
|
|
|
|
|
|
For a full list of supported analyzers, see:
|
|
|
|
https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md
|
2018-02-15 11:23:36 +00:00
|
|
|
|
2021-05-26 21:43:30 +00:00
|
|
|
|
|
|
|
g:ale_go_gopls_use_global *g:ale_go_gopls_use_global*
|
|
|
|
*b:ale_go_gopls_use_global*
|
|
|
|
Type: |String|
|
|
|
|
Default: `get(g:, 'ale_use_global_executables', 0)`
|
|
|
|
|
|
|
|
See |ale-integrations-local-executables|
|
|
|
|
|
|
|
|
|
2018-08-30 02:39:03 +00:00
|
|
|
===============================================================================
|
2019-04-10 18:23:06 +00:00
|
|
|
govet *ale-go-govet*
|
2018-08-30 02:39:03 +00:00
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
g:ale_go_govet_options *g:ale_go_govet_options*
|
|
|
|
*b:ale_go_govet_options*
|
2018-08-30 02:39:03 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
This variable can be set to pass additional options to the go vet linter.
|
2018-08-30 02:39:03 +00:00
|
|
|
|
|
|
|
|
2020-05-22 11:09:14 +00:00
|
|
|
===============================================================================
|
|
|
|
revive *ale-go-revive*
|
|
|
|
|
|
|
|
g:ale_go_revive_executable *g:ale_go_revive_executable*
|
|
|
|
*b:ale_go_revive_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'revive'`
|
|
|
|
|
|
|
|
This variable can be set to change the revive executable path.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_go_revive_options *g:ale_go_revive_options*
|
|
|
|
*b:ale_go_revive_options*
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options to the revive
|
|
|
|
|
|
|
|
|
2018-09-06 19:31:12 +00:00
|
|
|
===============================================================================
|
2019-04-10 18:23:06 +00:00
|
|
|
staticcheck *ale-go-staticcheck*
|
2018-09-06 19:31:12 +00:00
|
|
|
|
2021-05-27 21:03:39 +00:00
|
|
|
g:ale_go_staticcheck_executable *g:ale_go_staticcheck_executable*
|
|
|
|
*b:ale_go_staticcheck_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'staticcheck'`
|
|
|
|
|
|
|
|
See |ale-integrations-local-executables|
|
|
|
|
|
|
|
|
ALE will search for `staticcheck` in locally installed directories first by
|
|
|
|
default, and fall back on a globally installed `staticcheck` if it can't be
|
|
|
|
found otherwise.
|
|
|
|
|
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
g:ale_go_staticcheck_options *g:ale_go_staticcheck_options*
|
|
|
|
*b:ale_go_staticcheck_options*
|
2018-09-06 19:31:12 +00:00
|
|
|
Type: |String|
|
2019-04-10 18:23:06 +00:00
|
|
|
Default: `''`
|
2018-09-06 19:31:12 +00:00
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
This variable can be set to pass additional options to the staticcheck
|
|
|
|
linter.
|
2018-09-06 19:31:12 +00:00
|
|
|
|
|
|
|
|
2019-04-10 18:23:06 +00:00
|
|
|
g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package*
|
|
|
|
*b:ale_go_staticcheck_lint_package*
|
2018-09-06 19:31:12 +00:00
|
|
|
Type: |Number|
|
2022-04-05 12:25:42 +00:00
|
|
|
Default: `1`
|
2018-09-06 19:31:12 +00:00
|
|
|
|
|
|
|
When set to `1`, the whole Go package will be checked instead of only the
|
|
|
|
current file.
|
|
|
|
|
|
|
|
|
2021-05-27 21:03:39 +00:00
|
|
|
g:ale_go_staticcheck_use_global *g:ale_go_staticcheck_use_global*
|
|
|
|
*b:ale_go_staticcheck_use_global*
|
|
|
|
Type: |String|
|
|
|
|
Default: `get(g:, 'ale_use_global_executables', 0)`
|
|
|
|
|
|
|
|
See |ale-integrations-local-executables|
|
|
|
|
|
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2017-04-13 09:27:09 +00:00
|
|
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|