Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need the Go language runtime to run a compiled Go application?

Tags:

windows

go

With the Go programming language when I build an executable on Windows do I need the Go runtime installed to run the application on another machine?

like image 346
Mark Howard Avatar asked Nov 26 '15 19:11

Mark Howard


People also ask

Does Golang require runtime?

Does Go have a runtime? Go does have an extensive library, called the runtime, that is part of every Go program. The runtime library implements garbage collection, concurrency, stack management, and other critical features of the Go language.

Do I need Go to run a Go executable?

Once this executable is built, it will contain not only your application, but also all the support code needed to execute the binary on the target platform. This means that a Go binary does not need system dependencies such as Go tooling to run on a new system.

Do you need to install Go runtime to run Go binaries?

Yes, you don't need to install Golang itself to run your binary, it makes your deployment so much easier.

What is the Go runtime?

The Go runtime in the flexible environment is the software stack responsible for building and running your code. To choose the Go runtime in the flexible environment, add two lines to your app. yaml file. Runtimes in the flexible environment are built using Docker.


1 Answers

As long as any dependencies your program has are installed on the machine running the program, or your program is statically compiled, the user will be able to run your program without installing anything. A better answer might be here.

like image 115
Kookerus Avatar answered Sep 17 '22 11:09

Kookerus