summaryrefslogtreecommitdiff
path: root/ale_linters/go/gopls.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/go/gopls.vim')
-rw-r--r--ale_linters/go/gopls.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/ale_linters/go/gopls.vim b/ale_linters/go/gopls.vim
index c411dc2b..dcff5ec7 100644
--- a/ale_linters/go/gopls.vim
+++ b/ale_linters/go/gopls.vim
@@ -6,11 +6,15 @@ call ale#Set('go_gopls_executable', 'gopls')
call ale#Set('go_gopls_options', '--mode stdio')
function! ale_linters#go#gopls#GetCommand(buffer) abort
- return '%e' . ale#Pad(ale#Var(a:buffer, 'go_gopls_options'))
+ return ale#go#EnvString(a:buffer)
+ \ . '%e'
+ \ . ale#Pad(ale#Var(a:buffer, 'go_gopls_options'))
endfunction
function! ale_linters#go#gopls#FindProjectRoot(buffer) abort
- let l:project_root = ale#path#FindNearestFile(a:buffer, 'go.mod')
+ let l:go_modules_off = ale#Var(a:buffer, 'go_go111module') is# 'off'
+ let l:project_root = l:go_modules_off ?
+ \ '' : ale#path#FindNearestFile(a:buffer, 'go.mod')
let l:mods = ':h'
if empty(l:project_root)