summaryrefslogtreecommitdiff
path: root/ale_linters/go/gobuild.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/go/gobuild.vim')
-rw-r--r--ale_linters/go/gobuild.vim29
1 files changed, 16 insertions, 13 deletions
diff --git a/ale_linters/go/gobuild.vim b/ale_linters/go/gobuild.vim
index 5187c682..eee0bf84 100644
--- a/ale_linters/go/gobuild.vim
+++ b/ale_linters/go/gobuild.vim
@@ -4,22 +4,25 @@
" inspired by work from dzhou121 <dzhou121@gmail.com>
function! ale_linters#go#gobuild#GoEnv(buffer) abort
- if exists('s:go_env')
- return ''
- endif
+ if exists('s:go_env')
+ return ''
+ endif
- return 'go env GOPATH GOROOT'
+ return 'go env GOPATH GOROOT'
endfunction
function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
- if !exists('s:go_env')
- let s:go_env = {
- \ 'GOPATH': a:goenv_output[0],
- \ 'GOROOT': a:goenv_output[1],
- \}
- endif
- " 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 ./'
+ if !exists('s:go_env')
+ let s:go_env = {
+ \ 'GOPATH': a:goenv_output[0],
+ \ 'GOROOT': a:goenv_output[1],
+ \}
+ endif
+
+ " 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
@@ -42,7 +45,7 @@ function! ale_linters#go#gobuild#HandleGoBuildErrors(buffer, full_filename, line
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
- " Omit errors from imported go packages
+ " Omit errors from imported go packages
if len(l:match) == 0 || l:line !~ l:filename
continue
endif