Go checker: even more contortions.

This commit is contained in:
LCD 47 2015-01-15 18:06:46 +02:00
parent c60e440d00
commit 4d1f2e23ef

View File

@ -50,20 +50,16 @@ function! SyntaxCheckers_go_go_GetLocList() dict
" Test files, i.e. files with a name ending in `_test.go`, are not " 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. " compiled by `go build`, therefore `go test` must be called for those.
if match(expand('%', 1), '\m_test\.go$') == -1 if match(expand('%', 1), '\m_test\.go$') == -1
let cmd = 'build'
let opts = syntastic#util#var('go_go_build_args') let opts = syntastic#util#var('go_go_build_args')
if type(opts) != type('') || opts != ''
let opts = join(syntastic#util#argsescape(opts))
endif
let makeprg = self.getExec() . ' build ' . opts . ' ' . syntastic#c#NullOutput()
let cleanup = 0 let cleanup = 0
else else
let cmd = 'test -c'
let opts = syntastic#util#var('go_go_test_args') let opts = syntastic#util#var('go_go_test_args')
if type(opts) != type('') || opts != ''
let opts = join(syntastic#util#argsescape(opts))
endif
let makeprg = self.getExec() . ' test -c ' . opts . ' ' . syntastic#c#NullOutput()
let cleanup = 1 let cleanup = 1
endif endif
let opt_str = (type(opts) != type('') || opts != '') ? join(syntastic#util#argsescape(opts)) : opts
let makeprg = self.getExec() . ' ' . cmd . ' ' . opt_str . ' ' . syntastic#c#NullOutput()
" The first pattern is for warnings from C compilers. " The first pattern is for warnings from C compilers.
let errorformat = let errorformat =