Skip to content

Commit

Permalink
Add -trimpath for production build in project taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
leaanthony committed Apr 29, 2024
1 parent c38cee0 commit 38d9a95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v3/internal/templates/_common/Taskfile.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tasks:
cmds:
- go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{.ProjectName}}.exe
vars:
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s -H windowsgui\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -trimpath -ldflags=\"-w -s -H windowsgui\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
env:
GOOS: windows
CGO_ENABLED: 0
Expand Down Expand Up @@ -82,7 +82,7 @@ tasks:
cmds:
- go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{ "{{.APP_NAME}}" }}
vars:
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -trimpath -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
env:
GOOS: darwin
CGO_ENABLED: 1
Expand Down Expand Up @@ -136,7 +136,7 @@ tasks:
cmds:
- go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{.ProjectName}}
vars:
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -trimpath -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
env:
GOOS: linux
CGO_ENABLED: 1
Expand Down

0 comments on commit 38d9a95

Please sign in to comment.