Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Incorrect file returned by Location when vendored or in a different part of a multipart GOPATH. #8

Closed
ChrisHines opened this issue Apr 25, 2016 · 1 comment

Comments

@ChrisHines
Copy link
Contributor

To reproduce:

$ go get github.com/ChrisHines/pkg-errors-test
$ pkg-errors-test
ors-test.go:8: where am I?

To reproduce the multipart GOPATH scenario copy the pkg-errors-test repo to a different part of a mulitpart GOPATH from github.com/pkg/errors and delete the vendor folder. In that case you might see something like:

$ go run pkg-errors-test.go
hub.com/ChrisHines/pkg-errors-test/pkg-errors-test.go:8: where am I?

The exact output will depend on the path length delta between the two parts of the GOPATH.

I believe this can be fixed using a technique like what I have done here: https://github.com/go-stack/stack/blob/master/stack.go#L96.

I will work on a PR for this issue.

@davecheney
Copy link
Member

Thank you. Please do.

On Mon, 25 Apr 2016, 09:18 Chris Hines, [email protected] wrote:

To reproduce:

$ go get github.com/ChrisHines/pkg-errors-test
$ pkg-errors-test
ors-test.go:8: where am I?

To reproduce the multipart GOPATH scenario copy the pkg-errors-test repo
to a different part of a mulitpart GOPATH from github.com/pkg/errors and
delete the vendor folder. In that case you might see something like:

$ go run pkg-errors-test.gohub.com/ChrisHines/pkg-errors-test/pkg-errors-test.go:8: where am I?

The exact output will depend on the path length delta between the two
parts of the GOPATH.

I believe this can be fixed using a technique like what I have done here:
https://github.com/go-stack/stack/blob/master/stack.go#L96.

I will work on a PR for this issue.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#8

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

No branches or pull requests

2 participants