summaryrefslogtreecommitdiff
path: root/ale_linters/go
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/go')
-rw-r--r--ale_linters/go/gobuild.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/ale_linters/go/gobuild.vim b/ale_linters/go/gobuild.vim
new file mode 100644
index 00000000..1fd6b4c6
--- /dev/null
+++ b/ale_linters/go/gobuild.vim
@@ -0,0 +1,17 @@
+" Author: dzhou121 <dzhou121@gmail.com>
+" Description: go build for Go files
+
+function! s:FindGobuildScript() abort
+ return g:ale#util#stdin_wrapper . ' .go go build'
+endfunction
+
+let g:ale#util#gobuild_script =
+\ get(g:, 'ale_go_gobuild_script', s:FindGobuildScript())
+
+call ale#linter#Define('go', {
+\ 'name': 'go build',
+\ 'output_stream': 'stderr',
+\ 'executable': 'go',
+\ 'command': g:ale#util#gobuild_script,
+\ 'callback': 'ale#handlers#HandleUnixFormatAsError',
+\})