Skip to content

Commit a5e8ccc

Browse files
author
Adam Hughes
committedSep 30, 2021
build: use -trimpath in mage/goreleaser
1 parent 6f7ca18 commit a5e8ccc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎.goreleaser.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ builds:
2020
- 7
2121
env:
2222
- CGO_ENABLED=0
23+
flags: '-trimpath'
2324
ldflags: '-s -w -X main.version={{ .Version }} -X main.commit={{ .FullCommit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser'
2425
main: ./cmd/siftool
2526
mod_timestamp: '{{ .CommitTimestamp }}'

‎magefile.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (ns Build) All() {
7171

7272
// Source compiles all source code.
7373
func (Build) Source() error {
74-
return sh.Run(mg.GoCmd(), "build", "-ldflags", ldFlags(), "./...")
74+
return sh.Run(mg.GoCmd(), "build", "-trimpath", "-ldflags", ldFlags(), "./...")
7575
}
7676

7777
type Install mg.Namespace
@@ -83,7 +83,7 @@ func (ns Install) All() {
8383

8484
// Bin installs binary to GOBIN.
8585
func (Install) Bin() error {
86-
return sh.Run(mg.GoCmd(), "install", "-ldflags", ldFlags(), "./cmd/siftool")
86+
return sh.Run(mg.GoCmd(), "install", "-trimpath", "-ldflags", ldFlags(), "./cmd/siftool")
8787
}
8888

8989
type Test mg.Namespace

0 commit comments

Comments
 (0)
Please sign in to comment.