]> git.madduck.net Git - etc/vim.git/blob - autoload/ale/handlers/go.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / autoload / ale / handlers / go.vim
1 " Author: neersighted <bjorn@neersighted.com>
2 " Description: go vet for Go files
3 "
4 " Author: John Eikenberry <jae@zhar.net>
5 " Description: updated to work with go1.10
6 "
7 " Author: Ben Paxton <ben@gn32.uk>
8 " Description: moved to generic Golang file from govet
9 "
10 " Author: mostfunkyduck <mostfunkyduck@protonmail.com>
11 " Description: updated to work with go 1.14
12
13 function! ale#handlers#go#Handler(buffer, lines) abort
14     let l:pattern = '\v^%(vet: )?([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? ?(.+)$'
15     let l:output = []
16     let l:dir = expand('#' . a:buffer . ':p:h')
17
18     for l:match in ale#util#GetMatches(a:lines, l:pattern)
19         call add(l:output, {
20         \   'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
21         \   'lnum': l:match[2] + 0,
22         \   'col': l:match[3] + 0,
23         \   'text': l:match[4],
24         \   'type': 'E',
25         \})
26     endfor
27
28     return l:output
29 endfunction