diff --git a/syntax_checkers/go/go.vim b/syntax_checkers/go/go.vim index 37c297a0..a7f6b10a 100644 --- a/syntax_checkers/go/go.vim +++ b/syntax_checkers/go/go.vim @@ -50,20 +50,16 @@ 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('%', 1), '\m_test\.go$') == -1 + let cmd = 'build' 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 else + let cmd = 'test -c' 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 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. let errorformat =