summaryrefslogtreecommitdiff
path: root/ale_linters/go/gotype.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/go/gotype.vim')
-rw-r--r--ale_linters/go/gotype.vim12
1 files changed, 8 insertions, 4 deletions
diff --git a/ale_linters/go/gotype.vim b/ale_linters/go/gotype.vim
index 6a5149ca..8fd6df27 100644
--- a/ale_linters/go/gotype.vim
+++ b/ale_linters/go/gotype.vim
@@ -1,19 +1,23 @@
" Author: Jelte Fennema <github-public@jeltef.nl>
" Description: gotype for Go files
-function! ale_linters#go#gotype#GetCommand(buffer) abort
+function! ale_linters#go#gotype#GetExecutable(buffer) abort
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
return ''
endif
- return ale#path#BufferCdString(a:buffer) . ' '
- \ . ale#go#EnvString(a:buffer) . 'gotype -e .'
+ return 'gotype'
+endfunction
+
+function! ale_linters#go#gotype#GetCommand(buffer) abort
+ return ale#go#EnvString(a:buffer) . 'gotype -e .'
endfunction
call ale#linter#Define('go', {
\ 'name': 'gotype',
\ 'output_stream': 'stderr',
-\ 'executable': 'gotype',
+\ 'executable': function('ale_linters#go#gotype#GetExecutable'),
+\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#gotype#GetCommand'),
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,