Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When building Go programs for release is it standard practice to just use 'go build'?

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.

like image 310
Gary Willoughby Avatar asked Feb 21 '15 19:02

Gary Willoughby


1 Answers

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/

like image 76
Gary Willoughby Avatar answered Oct 05 '22 00:10

Gary Willoughby