-
Notifications
You must be signed in to change notification settings - Fork 17.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"go build -trimpath" trims the recorded file paths in the resulting packages and executables to avoid recording the names of any local directories. Instead, the files appear to be stored in directories named either "go/src/..." (for the standard library) or named after the module or package in which the files appear. Fixes #16860. Change-Id: I433afeeb1fdeea641286b21693fee5e0a66d607e Reviewed-on: https://go-review.googlesource.com/c/go/+/173345 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
- Loading branch information
Showing
8 changed files
with
85 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
env -r GOROOT_REGEXP=$GOROOT | ||
env -r WORK_REGEXP=$WORK | ||
env GOROOT GOROOT_REGEXP WORK WORK_REGEXP | ||
|
||
go build -trimpath -o hello.exe hello.go | ||
! grep -q $GOROOT_REGEXP hello.exe | ||
! grep -q $WORK_REGEXP hello.exe | ||
|
||
env GO111MODULE=on | ||
go build -trimpath -o fortune.exe rsc.io/fortune | ||
! grep -q $GOROOT_REGEXP fortune.exe | ||
! grep -q $WORK_REGEXP fortune.exe | ||
|
||
-- hello.go -- | ||
package main | ||
func main() { println("hello") } | ||
|
||
-- go.mod -- | ||
module m |