2018-02-25 11:39:45 +00:00
|
|
|
Before:
|
2018-09-19 18:33:23 +00:00
|
|
|
Save g:ale_go_go_executable
|
|
|
|
Save g:ale_go_govet_options
|
2019-08-02 08:09:10 +00:00
|
|
|
Save g:ale_go_go111module
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('go', 'govet')
|
2018-02-25 11:39:45 +00:00
|
|
|
|
|
|
|
After:
|
2018-09-19 18:33:23 +00:00
|
|
|
Restore
|
2019-08-02 08:09:10 +00:00
|
|
|
|
|
|
|
unlet! b:ale_go_go111module
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2018-02-25 11:39:45 +00:00
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
Execute(The default go vet command should be correct):
|
|
|
|
AssertLinter 'go', ale#Escape('go') . ' vet .'
|
2021-03-01 20:11:10 +00:00
|
|
|
AssertLinterCwd '%s:h'
|
2018-09-19 18:33:23 +00:00
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
Execute(The go vet command and options should be configurable):
|
2018-09-19 18:33:23 +00:00
|
|
|
let g:ale_go_go_executable = 'foobar'
|
2023-09-16 21:22:01 +00:00
|
|
|
let g:ale_go_govet_options = '--foo-bar'
|
2019-08-02 08:09:10 +00:00
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
AssertLinter 'foobar', ale#Escape('foobar') . ' vet --foo-bar .'
|
2019-04-11 02:25:06 +00:00
|
|
|
|
|
|
|
Execute(Go environment variables should be supported):
|
|
|
|
let b:ale_go_go111module = 'on'
|
2019-08-02 08:09:10 +00:00
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
AssertLinter 'go', ale#Env('GO111MODULE', 'on') . ale#Escape('go') . ' vet .'
|