Fix gobuild linter

Resolves issues with gobuild linter with multiple go source files
belonging to the same go package.
This commit is contained in:
Ben Reedy 2017-04-13 18:58:55 +10:00
parent e2287a42bc
commit a2bb45e974
No known key found for this signature in database
GPG Key ID: 235C15B6086C9D7E
1 changed files with 2 additions and 2 deletions

View File

@ -18,8 +18,8 @@ function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
\ 'GOROOT': a:goenv_output[1],
\}
endif
return 'GOPATH=' . s:go_env.GOPATH . ' go test -c -o /dev/null %s'
" Run go test in local directory with relative path
return 'GOPATH=' . s:go_env.GOPATH . ' cd ' . fnamemodify(bufname(a:buffer), ':.:h') . ' && go test -c -o /dev/null ./'
endfunction
function! ale_linters#go#gobuild#Handler(buffer, lines) abort