From 49db8210f68637a2af14b21940f3cbbaf7361047 Mon Sep 17 00:00:00 2001 From: Elias Martinez Cohen Date: Wed, 10 Apr 2019 22:25:06 -0400 Subject: Support $GO111MODULE with Go tooling 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` --- test/command_callback/test_govet_command_callback.vader | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/command_callback/test_govet_command_callback.vader') diff --git a/test/command_callback/test_govet_command_callback.vader b/test/command_callback/test_govet_command_callback.vader index a55c0812..163fd8ea 100644 --- a/test/command_callback/test_govet_command_callback.vader +++ b/test/command_callback/test_govet_command_callback.vader @@ -17,3 +17,11 @@ Execute(Extra options should be supported): Execute(The executable should be configurable): let g:ale_go_go_executable = 'foobar' AssertLinter 'foobar', ale#path#CdString(expand('%:p:h')) . ' foobar vet .' + +Execute(Go environment variables should be supported): + let b:ale_go_go111module = 'on' + AssertLinter 'go', + \ ale#path#CdString(expand('%:p:h')) . ' ' + \ . ale#Env('GO111MODULE', 'on') + \ . 'go vet .' + unlet! b:ale_go_go111module -- cgit v1.2.3