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

Truncate file paths to $GOPATH #304

Closed
akshayjshah opened this issue Feb 16, 2017 · 2 comments
Closed

Truncate file paths to $GOPATH #304

akshayjshah opened this issue Feb 16, 2017 · 2 comments

Comments

@akshayjshah
Copy link
Contributor

When adding caller annotations, it's irritating to use the absolute path - the caller annotations become quite long. We should instead report the file's location with $GOPATH stripped off (which should leave files outside $GOPATH unchanged).

@skipor
Copy link
Contributor

skipor commented Feb 18, 2017

go-stack have nice implementation of this that can be used as starting point

skipor added a commit to skipor/zap that referenced this issue Feb 19, 2017
Add GoPathCallerEncoder that trims caller file to compile time $GOPATH.
Use it by default.
$GOPATH trim logic based on go-stack/stack which is under Apache license, so can't be put in repo.
So required logic have been moved to another repo, and exported.
@akshayjshah
Copy link
Contributor Author

Closing in favor of #319.

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

No branches or pull requests

2 participants