2016-10-11 07:57:42 -04:00
|
|
|
" Author: neersighted <bjorn@neersighted.com>
|
|
|
|
" Description: go vet for Go files
|
2018-02-25 06:39:45 -05:00
|
|
|
"
|
|
|
|
" Author: John Eikenberry <jae@zhar.net>
|
|
|
|
" Description: updated to work with go1.10
|
|
|
|
|
2018-09-19 14:33:23 -04:00
|
|
|
call ale#Set('go_go_executable', 'go')
|
2018-08-15 22:02:51 -04:00
|
|
|
call ale#Set('go_govet_options', '')
|
|
|
|
|
2018-02-25 06:39:45 -05:00
|
|
|
function! ale_linters#go#govet#GetCommand(buffer) abort
|
2018-08-15 22:02:51 -04:00
|
|
|
let l:options = ale#Var(a:buffer, 'go_govet_options')
|
2018-09-04 11:51:18 -04:00
|
|
|
|
2018-09-19 14:33:23 -04:00
|
|
|
return ale#path#BufferCdString(a:buffer) . ' '
|
|
|
|
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
|
2018-08-15 22:02:51 -04:00
|
|
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
2018-09-19 14:33:23 -04:00
|
|
|
\ . ' .'
|
2018-02-25 06:39:45 -05:00
|
|
|
endfunction
|
|
|
|
|
2016-10-11 07:57:42 -04:00
|
|
|
call ale#linter#Define('go', {
|
2018-07-24 05:05:44 -04:00
|
|
|
\ 'name': 'govet',
|
|
|
|
\ 'aliases': ['go vet'],
|
2016-10-11 07:57:42 -04:00
|
|
|
\ 'output_stream': 'stderr',
|
2018-09-19 14:33:23 -04:00
|
|
|
\ 'executable_callback': ale#VarFunc('go_go_executable'),
|
2018-02-25 06:39:45 -05:00
|
|
|
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
|
2018-03-20 10:19:48 -04:00
|
|
|
\ 'callback': 'ale#handlers#go#Handler',
|
2018-02-25 06:39:45 -05:00
|
|
|
\ 'lint_file': 1,
|
2016-10-11 07:57:42 -04:00
|
|
|
\})
|