summaryrefslogtreecommitdiff
path: root/ale_linters/go/gopls.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2021-05-27 22:03:39 +0100
committerw0rp <devw0rp@gmail.com>2021-05-27 22:03:46 +0100
commit1b08791228f5aca4545a3fba6699b29a003028fe (patch)
tree42cb78fe66f93100217ecb1230c269c26d58db1b /ale_linters/go/gopls.vim
parenta02a4f2811f810877f3c3859cca963f9578ff94a (diff)
downloadale-1b08791228f5aca4545a3fba6699b29a003028fe.zip
Make staticcheck configurable with GOPATH detection
Diffstat (limited to 'ale_linters/go/gopls.vim')
-rw-r--r--ale_linters/go/gopls.vim16
1 files changed, 1 insertions, 15 deletions
diff --git a/ale_linters/go/gopls.vim b/ale_linters/go/gopls.vim
index 23082e9b..80909830 100644
--- a/ale_linters/go/gopls.vim
+++ b/ale_linters/go/gopls.vim
@@ -7,20 +7,6 @@ call ale#Set('go_gopls_options', '--mode stdio')
call ale#Set('go_gopls_init_options', {})
call ale#Set('go_gopls_use_global', get(g:, 'ale_use_global_executables', 0))
-function! s: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
-
function! ale_linters#go#gopls#GetCommand(buffer) abort
return ale#go#EnvString(a:buffer)
\ . '%e'
@@ -45,7 +31,7 @@ call ale#linter#Define('go', {
\ 'name': 'gopls',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_gopls', [
-\ s:GetGoPathExecutable('bin/gopls'),
+\ ale#go#GetGoPathExecutable('bin/gopls'),
\ ])},
\ 'command': function('ale_linters#go#gopls#GetCommand'),
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),