2018-03-31 10:55:20 -04:00
|
|
|
" Author: neersighted <bjorn@neersighted.com>
|
|
|
|
" Description: go vet for Go files
|
|
|
|
"
|
|
|
|
" Author: John Eikenberry <jae@zhar.net>
|
|
|
|
" Description: updated to work with go1.10
|
|
|
|
|
2018-09-24 20:40:17 -04:00
|
|
|
call ale#Set('go_go_executable', 'go')
|
2018-08-25 12:13:42 -04:00
|
|
|
call ale#Set('go_govet_options', '')
|
|
|
|
|
2018-03-31 10:55:20 -04:00
|
|
|
function! ale_linters#go#govet#GetCommand(buffer) abort
|
2018-08-25 12:13:42 -04:00
|
|
|
let l:options = ale#Var(a:buffer, 'go_govet_options')
|
2018-09-24 20:40:17 -04:00
|
|
|
|
|
|
|
return ale#path#BufferCdString(a:buffer) . ' '
|
2019-08-22 11:36:17 -04:00
|
|
|
\ . ale#go#EnvString(a:buffer)
|
2018-09-24 20:40:17 -04:00
|
|
|
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
|
2018-08-25 12:13:42 -04:00
|
|
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
2018-09-24 20:40:17 -04:00
|
|
|
\ . ' .'
|
2018-03-31 10:55:20 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('go', {
|
2018-07-30 17:18:16 -04:00
|
|
|
\ 'name': 'govet',
|
|
|
|
\ 'aliases': ['go vet'],
|
2018-03-31 10:55:20 -04:00
|
|
|
\ 'output_stream': 'stderr',
|
2019-03-08 06:04:56 -05:00
|
|
|
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
|
|
|
\ 'command': function('ale_linters#go#govet#GetCommand'),
|
2018-03-31 10:55:20 -04:00
|
|
|
\ 'callback': 'ale#handlers#go#Handler',
|
|
|
|
\ 'lint_file': 1,
|
|
|
|
\})
|