Coming from a JVM background I would like to know how to deploy a golang project to production. Is there an equivalent of a JAR file?
Is there a standalone package manager that can be installed on server and a dependency manifest file which can be run to bring down all dependencies on the server. I specifically do not want to have to build the project on the server as we can't have any compilers etc on production boxes.
thanks.
I you run go install <pkg>
, the binary will be placed in $GOPATH/bin
. You can copy that binary to another machine that has the same OS and architecture.
You can also change into the directory that includes the main
package and just run go build
. The binary will be placed in the current directory.
There are no dependencies in a Go binary for you to track. It is statically linked. (Some system libraries may be dynamically linked, but if you are running on the same OS, this shouldn't be a problem.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With