From cab68cba250fb81a4d20ffd637925a708bb46e8a Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 15 Apr 2017 12:52:08 +0100 Subject: Make code more consistent --- ale_linters/go/gobuild.vim | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'ale_linters/go') 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 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 -- cgit v1.2.3