cli 

Send to Kindle
home » snippets » go » cli



Building

# -i: install dependencies
# -a: force rebuild
# -x: (trace) print the commands
go build -o binary_name -i -a -x [packages]

Linking

Snippets

# Strip debugging info
# -s: disable symbol table
# -w: disable DWARF generation
go build -ldflags "-s -w" file.go

# What are the linking flags?
go tool 6l -help