Go and govet checkers: make go executable configurable.
This commit is contained in:
parent
f583df730d
commit
21f052ab02
@ -23,7 +23,7 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_go_IsAvailable() dict
|
||||
return executable('go') && executable('gofmt')
|
||||
return executable(self.getExec()) && executable('gofmt')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
@ -50,10 +50,10 @@ function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
" Test files, i.e. files with a name ending in `_test.go`, are not
|
||||
" compiled by `go build`, therefore `go test` must be called for those.
|
||||
if match(expand('%'), '\m_test\.go$') == -1
|
||||
let makeprg = 'go build ' . syntastic#c#NullOutput()
|
||||
let makeprg = self.getExec() . ' build ' . syntastic#c#NullOutput()
|
||||
let cleanup = 0
|
||||
else
|
||||
let makeprg = 'go test -c ' . syntastic#c#NullOutput()
|
||||
let makeprg = self.getExec() . ' test -c ' . syntastic#c#NullOutput()
|
||||
let cleanup = 1
|
||||
endif
|
||||
|
||||
|
@ -19,11 +19,11 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_go_govet_IsAvailable() dict
|
||||
return executable('go')
|
||||
return executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_govet_GetLocList() dict
|
||||
let makeprg = 'go vet'
|
||||
let makeprg = self.getExec() . ' vet'
|
||||
|
||||
let errorformat =
|
||||
\ '%Evet: %.%\+: %f:%l:%c: %m,' .
|
||||
@ -43,7 +43,8 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'go',
|
||||
\ 'name': 'govet'})
|
||||
\ 'name': 'govet',
|
||||
\ 'exec': 'go' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
Loading…
x
Reference in New Issue
Block a user