A typical release pipeline pattern.

Section: Release Packaging

Test then build

bash
bash
go test ./... && go build -trimpath -o ./dist/app .
Explanation

A typical release pipeline pattern. Useful in Go CLI workflows.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Release Packaging
Generate code before build
Run go generate directives before compiling.
OpenIn sheetbashsame section
Build command packages
Install all command packages under cmd/.
OpenIn sheetbashsame section
List target platforms
Print supported GOOS/GOARCH pairs.
OpenIn sheetbash1 tag match
Trim source paths
Remove local filesystem paths from compiled output.
OpenIn sheetbash1 tag match
Inspect build info
Show module/build info embedded in a binary.
OpenIn sheetbash1 tag match
Build Linux amd64
Cross-compile for Linux amd64.
OpenIn sheetbash1 tag match