summaryrefslogtreecommitdiff
path: root/ale_linters/go/gobuild.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-04-15 12:52:08 +0100
committerw0rp <devw0rp@gmail.com>2017-04-15 12:52:08 +0100
commitcab68cba250fb81a4d20ffd637925a708bb46e8a (patch)
tree14a917e41e977aa5cd591ebdb2a2eda7c29530f3 /ale_linters/go/gobuild.vim
parentc9a5d9845b9bff9174c4bb3b67a9f7bfda190ee6 (diff)
downloadale-cab68cba250fb81a4d20ffd637925a708bb46e8a.zip
Make code more consistent
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