Reputation: 52508
When building Go programs for release is it standard practise to just use go build
without any other options? I ask because when building using go build
all debug information is included by default. To remove it you can pass an option to the linker, thus:
go build -ldflags "-w" prog.go
This omits all debug symbols. When building programs for release do you remove this information or leave it intact?
EDIT: For clarity, i'm wondering how people compile Go programs for deployment to a live environment. In other compiled languages you have a different set of compiler command line options for debugging and release builds and release builds usually optimise the executable and remove debugging information.
Upvotes: 19
Views: 6424
Reputation: 52508
According to Dave Cheney the answer is yes, just use go build
.
Source: http://www.reddit.com/r/golang/comments/2woogl/when_building_go_programs_for_release_is_it/
Upvotes: 3