summaryrefslogtreecommitdiff
path: root/ale_linters/go/gobuild.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2023-09-16 22:22:01 +0100
committerw0rp <devw0rp@gmail.com>2023-09-16 22:23:30 +0100
commitae1d0515049ed135878672e06b51b083f5ae384d (patch)
tree1556645edaf786bc934be9cc8cc63408e65054d4 /ale_linters/go/gobuild.vim
parent4b11cf21dc8406b579b89e50ae3f08ef2c0856e1 (diff)
downloadale-ae1d0515049ed135878672e06b51b083f5ae384d.zip
#4454 Clean up more tests and code
* Remove some tests we no longer need * Delete blocks of redundant code * Compress some tests together to simplify them * Remove a little code for ancient linter versions * Escape more executables we didn't escape before * Rename a deno option that didn't match our conventions
Diffstat (limited to 'ale_linters/go/gobuild.vim')
-rw-r--r--ale_linters/go/gobuild.vim17
1 files changed, 6 insertions, 11 deletions
diff --git a/ale_linters/go/gobuild.vim b/ale_linters/go/gobuild.vim
index 5210c5a8..0342a230 100644
--- a/ale_linters/go/gobuild.vim
+++ b/ale_linters/go/gobuild.vim
@@ -6,16 +6,6 @@
call ale#Set('go_go_executable', 'go')
call ale#Set('go_gobuild_options', '')
-function! ale_linters#go#gobuild#GetCommand(buffer) abort
- let l:options = ale#Var(a:buffer, 'go_gobuild_options')
-
- " Run go test in local directory with relative path
- return ale#go#EnvString(a:buffer)
- \ . ale#Var(a:buffer, 'go_go_executable') . ' test'
- \ . (!empty(l:options) ? ' ' . l:options : '')
- \ . ' -c -o /dev/null ./'
-endfunction
-
function! ale_linters#go#gobuild#GetMatches(lines) abort
" Matches patterns like the following:
"
@@ -50,7 +40,12 @@ call ale#linter#Define('go', {
\ 'aliases': ['go build'],
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
-\ 'command': function('ale_linters#go#gobuild#GetCommand'),
+\ 'command': {b ->
+\ ale#go#EnvString(b)
+\ . ale#Escape(ale#Var(b, 'go_go_executable')) . ' test'
+\ . ale#Pad(ale#Var(b, 'go_gobuild_options'))
+\ . ' -c -o /dev/null ./'
+\ },
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#go#gobuild#Handler',
\ 'lint_file': 1,