syntastic
syntastic copied to clipboard
Add a new Go linter: gopls
gopls is a new Language Server Protocol implementation for Go. With recent releases, it can also be used as a standalone linter.
This new checker uses gopls to check Go programs.
Your commit doesn't include the actual checker. :smile:
Anyway, please consider adding this to ALE and / or vim-go instead. The go
checkers in syntastic are still around only for backwards compatibility, they don't serve any real purpose these days.
From my end, the checker seems to be in the commit. gopls is already supported by ALE and vim-go. I'm using syntastic, so this checker was useful to me.
From my end, the checker seems to be in the commit.
Right, I can see it now too. So either I discovered a race condition in GitHub, or I was just imagining things. I guess I'll spend the rest of my life wondering.
I'm using syntastic, so this checker was useful to me.
Well, the point still stands: go
checkers should have been deleted a long time ago, and adding more checkers for me to take care of is not a step in that direction. Also, syntastic is essentially dead these days.
Anyway, about the checker:
- In
IsAvailable()
you should probably parse the output rather than checkv:shell_error
. The latter is known not to work reliably under thecmd.exe
shell on Windows, so it should be avoided when possible. - You probably want
let errorformat = ... '%f:%l:%c-%\d%\+: %m,' ...
. Backslashes have no special meaning inside single quotes. - The
exec
inCreateAndRegisterChecker()
is redundant but not wrong.
- Parsing the output in IsAvailable would no really be helpful. The first versions of gopls did not understand the commands "version" and "check" (this is the case of the gopls available in Debian). So either "gopls version" fails as it does not understand "go version", and we can't use it. Or it succeed, and can be used.
- I've correcter errorformat.
I also tested gopls on Windows. It does correctly return an error code if it does not understand the option provided.