new go syntax checker #150

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

This adds a new syntax checker for go which uses the gofmt tool. I copied
support for multiple checkers from the javascript.vim.

To avoid making a mess I needed to change shellpipe during the make so
that is added as an option.

I think gofmt is a better default checker for go so I made it the first one
but I guess any existing users may also not want their setting to change.
I'm not sure if there is a good way around that.

Brandon Thomson New gofmt checker for go; add shellpipe option
This adds a new syntax checker for go which uses the gofmt tool. To
avoid making a mess we needed to change shellpipe during the make so
that is added as an option which other checkers can also modify.
3fefcec
Collaborator

scrooloose commented Feb 1, 2012

Hey, im keen to get the gofmt checker, but it can be done like this (without the need to add the shellpipe option):

function! SyntaxCheckers_go_GetLocList()
    let makeprg = 'gofmt %'
    let errorformat = '%f:%l:%c: %m,%-G%.%#'
    return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} })
endfunction

The key bit here is the %-G%.%# which matches anything and ignores it.

I would rather avoid letting syntax checkers change shellpipe as this can cause the screen to flicker (or otherwise spaz out) if set wrong.

If you remove the shellpipe code then ill pull - or I can just hack it myself if you cant be stuffed :-)

Sure mate, I'll take care of it soon. I need to learn more about how this pull request thing works anyhow (never tried it before)

@scrooloose scrooloose added a commit that referenced this pull request Feb 11, 2012

@scrooloose scrooloose go: add gofmt checker from #150 3be5136
Collaborator

scrooloose commented Feb 11, 2012

Hey, just added the gofmt syntax checker. Let me know if there are any problems :)

scrooloose closed this Feb 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment