Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filepaths in the quickfix list for :GoVet #1381

Merged
merged 1 commit into from
Aug 5, 2017
Merged

Fix filepaths in the quickfix list for :GoVet #1381

merged 1 commit into from
Aug 5, 2017

Conversation

arp242
Copy link
Contributor

@arp242 arp242 commented Jul 25, 2017

The go vet command would be run with go#tool#ExecuteInDir(), which
translates to cd dir && go vet.

The problem with this is that if I have subpkg/file.go open, the filename that
go vet reports will be file.go, rather than subpkg/file.go. As a result,
the filepath set in the quickfix or location list is also wrong and jumping to
this error will jump to a new (usually non-existing) buffer.

Fix it by explicitly passing the package path, rather than changing the cwd.

Fixes #1376

The `go vet` command would be run with `go#tool#ExecuteInDir()`, which
translates to `cd dir && go vet`.

The problem with this is that if I have `subpkg/file.go` open, the filename that
`go vet` reports will be `file.go`, rather than `subpkg/file.go`. As a result,
the filepath set in the quickfix or location list is also wrong and jumping to
this error will jump to a new (usually non-existing) buffer.

Fix it by explicitly passing the package path, rather than changing the cwd.

Fixes #1376
@fatih fatih merged commit 13b9eb5 into fatih:master Aug 5, 2017
@fatih
Copy link
Owner

fatih commented Aug 5, 2017

Thanks @Carpetsmoker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using "vim subpkg/file.go" and :GoVet will clear the buffer when there are errors
2 participants