What version of Go are you using (go version)?
go 1.9.1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
does not matter (linux, windows)
What did you do?
When I run go build -gcflags -trimpath somepath go will execute go tool compile -trimpath $WORK -trimpath somepath during build process. Due to this default -trimpath $WORK is not effective.
Another use case is go build -gcflags -trimpath $GOPATH because I want to prevent storing my username (from the homedir) to built binaries and I have more directories in the GOPATH.
What did you expect to see?
all trimpath arguments are used
What did you see instead?
last trimpath argument is used
What version of Go are you using (
go version)?go 1.9.1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env)?does not matter (linux, windows)
What did you do?
When I run
go build -gcflags -trimpath somepathgo will executego tool compile -trimpath $WORK -trimpath somepathduring build process. Due to this default-trimpath $WORKis not effective.Another use case is
go build -gcflags -trimpath $GOPATHbecause I want to prevent storing my username (from the homedir) to built binaries and I have more directories in theGOPATH.What did you expect to see?
all trimpath arguments are used
What did you see instead?
last trimpath argument is used