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`
16 lines
435 B
VimL
16 lines
435 B
VimL
" Author: neersighted <bjorn@neersighted.com>
|
|
" Description: gofmt for Go files
|
|
|
|
function! ale_linters#go#gofmt#GetCommand(buffer) abort
|
|
return ale#go#EnvString(a:buffer)
|
|
\ . '%e -e %t'
|
|
endfunction
|
|
|
|
|
|
call ale#linter#Define('go', {
|
|
\ 'name': 'gofmt',
|
|
\ 'output_stream': 'stderr',
|
|
\ 'executable': 'gofmt',
|
|
\ 'command': function('ale_linters#go#gofmt#GetCommand'),
|
|
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
|
\})
|