bugfix: use go test
for test files.
Test files are not compiled when invoking `go build`.
This commit is contained in:
parent
90a4a0571d
commit
96e0ce95b8
@ -1,6 +1,6 @@
|
|||||||
"============================================================================
|
"============================================================================
|
||||||
"File: go.vim
|
"File: go.vim
|
||||||
"Description: Check go syntax using 'go build'
|
"Description: Check go syntax using 'go [build|test]'
|
||||||
"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
|
"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
|
||||||
"License: This program is free software. It comes without any warranty,
|
"License: This program is free software. It comes without any warranty,
|
||||||
" to the extent permitted by applicable law. You can redistribute
|
" to the extent permitted by applicable law. You can redistribute
|
||||||
@ -10,8 +10,14 @@
|
|||||||
"
|
"
|
||||||
"============================================================================
|
"============================================================================
|
||||||
function! SyntaxCheckers_go_GetLocList()
|
function! SyntaxCheckers_go_GetLocList()
|
||||||
let makeprg = 'go build -o /dev/null'
|
" Test files, i.e. files with a name ending in `_test.go`, are not
|
||||||
let errorformat = '%f:%l:%c:%m,%E%f:%l:%m,%C%m,%-G#%.%#'
|
" compiled by `go build`, therefore `go test` must be called for those.
|
||||||
|
if match(expand('%'), '_test.go$') == -1
|
||||||
|
let makeprg = 'go build -o /dev/null'
|
||||||
|
else
|
||||||
|
let makeprg = 'go test -c -o /dev/null'
|
||||||
|
endif
|
||||||
|
let errorformat = '%f:%l:%c:%m,%f:%l%m,%-G#%.%#'
|
||||||
|
|
||||||
" The go compiler needs to either be run with an import path as an
|
" The go compiler needs to either be run with an import path as an
|
||||||
" argument or directly from the package directory. Since figuring out
|
" argument or directly from the package directory. Since figuring out
|
||||||
|
Loading…
Reference in New Issue
Block a user