mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-19 02:01:03 +08:00
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`
12 lines
331 B
VimL
12 lines
331 B
VimL
call ale#Set('go_go_executable', 'go')
|
|
|
|
function! ale#fixers#gomod#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'go_go_executable')
|
|
let l:env = ale#go#EnvString(a:buffer)
|
|
|
|
return {
|
|
\ 'command': l:env . ale#Escape(l:executable) . ' mod edit -fmt %t',
|
|
\ 'read_temporary_file': 1,
|
|
\}
|
|
endfunction
|