Skip to content

Commit

Permalink
Checker go/gotype: option "-a" is now "-t".
Browse files Browse the repository at this point in the history
  • Loading branch information
lcd047 committed May 13, 2017
1 parent e07319f commit fc7d4ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin/syntastic.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif

let g:_SYNTASTIC_VERSION = '3.8.0-52'
let g:_SYNTASTIC_VERSION = '3.8.0-53'
lockvar g:_SYNTASTIC_VERSION

" Sanity checks {{{1
Expand Down
18 changes: 17 additions & 1 deletion syntax_checkers/go/gotype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,24 @@ set cpo&vim

function! SyntaxCheckers_go_gotype_GetLocList() dict
let buf = bufnr('')

if !exists('s:go_new')
let command = syntastic#util#shescape(syntastic#util#bufVar(buf, 'go_go_exec', 'go')) . ' version'
let version_output = syntastic#util#system(command)
call self.log('finding go version: ' . string(command) . ': ' .
\ string(split(version_output, "\n", 1)) .
\ (v:shell_error ? ' (exit code ' . v:shell_error . ')' : ''))
let parsed_ver = syntastic#util#parseVersion(version_output)
if len(parsed_ver)
let s:go_new = syntastic#util#versionIsAtLeast(parsed_ver, [1, 8])
else
call syntastic#log#error("checker " . self.getCName() . ": can't parse go version (abnormal termination?)")
return []
endif
endif

let makeprg = self.makeprgBuild({
\ 'args': (bufname(buf) =~# '\m_test\.go$' ? '-a' : ''),
\ 'args': (bufname(buf) =~# '\m_test\.go$' ? (s:go_new ? '-t' : '-a') : ''),
\ 'fname': '.' })

let errorformat =
Expand Down

0 comments on commit fc7d4ce

Please sign in to comment.