pkg / errors

Simple error handling primitives
https://godoc.org/github.com/pkg/errors
BSD 2-Clause "Simplified" License
8.18k stars 691 forks source link

respect -trimpath build flag #222

Closed axetroy closed 4 years ago

axetroy commented 4 years ago

Remove the $GOPATH path when go build

But doesn't seem to work for this library

go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH xxxxxxx
davecheney commented 4 years ago

What doesn’t work?

What did you do?

What did you expect to see?

What did you see instead?

axetroy commented 4 years ago

@davecheney -trimpath flag will delete the specified path in the stack information

This ensures that the stack information does not expose the path

But it seems that the stack information generated using pkg/errors still contains these paths

davecheney commented 4 years ago

I don't think I can help you. -trimpath is handled by the compiler. This package doesn't have access to this flag at runtime. I suggest raising an issue on golang/go if -trimpath does not work.