mirror of
https://github.com/dense-analysis/ale
synced 2024-12-25 15:42:26 +00:00
49db8210f6
Allows the user to override $GO111MODULE environment variable through ale options. This gives control over the default behavior of Go module resolution. Golang documentation: https://github.com/golang/go/wiki/Modules#how-to-use-modules Add `ale#Go#EnvString()` function to make it easy to add similar Go environment variables in the future. Use the new `EnvString` function in all available Go tools callbacks & update tests Also add test of linter command callback for `gofmt`
17 lines
507 B
VimL
17 lines
507 B
VimL
" Author: Ben Reedy <https://github.com/breed808>
|
|
" Description: gosimple for Go files
|
|
|
|
function! ale_linters#go#gosimple#GetCommand(buffer) abort
|
|
return ale#path#BufferCdString(a:buffer) . ' '
|
|
\ . ale#go#EnvString(a:buffer) . 'gosimple .'
|
|
endfunction
|
|
|
|
call ale#linter#Define('go', {
|
|
\ 'name': 'gosimple',
|
|
\ 'executable': 'gosimple',
|
|
\ 'command': function('ale_linters#go#gosimple#GetCommand'),
|
|
\ 'callback': 'ale#handlers#go#Handler',
|
|
\ 'output_stream': 'both',
|
|
\ 'lint_file': 1,
|
|
\})
|