joefitzgerald / gometalinter-linter

A Linter For Atom That Runs gometalinter
Other
18 stars 3 forks source link

Opens up error in non-existent file #60

Open atombender opened 8 years ago

atombender commented 8 years ago

My codebase suddenly got into a state where, if I hit the "show next error" keyboard shortcut, it opens a new, blank file named system/vet: manager.go: manager.go.

Looks like the output from gometalinter is being misparsed. There's a genuine error somewhere in the code, but that's not a file name.

Here's a screenshot.

screen shot 2016-09-30 at 21 39 00

Developer console shows this:

screen shot 2016-09-30 at 21 39 09

Latest versions of gometalinter and gometalinter-linter.

atombender commented 8 years ago

I can reproduce it consistently:

package main

func main([]) {}
jonatin commented 7 years ago

@atombender did you perhaps append "./..." to the options?

It appears this is in the command line defaults and whenever I add this it causes this exact issue for me as well. Perhaps your command line options are invalid and it's falling back on these hard-coded defaults? Try looking for missing commas between switches.

jonatin commented 7 years ago

Or not... actually this appears to be due to a symlink in my GOPATH.

I've symlinked GOPATH from a directory in my $HOME to another volume. The symlink in my $HOME is what appears in the $GOPATH env var. Once I set the GOPATH option in the go-config plugin settings to the actual volume these files started opening correctly.

atombender commented 7 years ago

I don't use symlinks, but I did have the package configured with ./.... I recently changed it to . and haven't seen the problem since, but that could be a coincidence.

joefitzgerald commented 7 years ago

This looks to be an issue with gometalinter output for vet and vetshadow; an extra segment is being added with the filename. This changed recently; it's different to the format used by all the other linters. I've opened up https://github.com/alecthomas/gometalinter/issues/179 to track it, as it sounds like the regex used to parse the vet/vetshadow output needs modification.