Make staticcheck configurable with GOPATH detection

This commit is contained in:
w0rp
2021-05-27 22:03:39 +01:00
parent a02a4f2811
commit 1b08791228
6 changed files with 63 additions and 25 deletions

View File

@@ -42,3 +42,17 @@ function! ale#go#EnvString(buffer) abort
return l:env
endfunction
function! ale#go#GetGoPathExecutable(suffix) abort
let l:prefix = $GOPATH
if !empty($GOPATH)
let l:prefix = $GOPATH
elseif has('win32')
let l:prefix = $USERPROFILE . '/go'
else
let l:prefix = $HOME . '/go'
endif
return ale#path#Simplify(l:prefix . '/' . a:suffix)
endfunction