In this tutorial you will learn how to compile / build and run a go ( golang ) program in Linux operating system.
Here i’m using Manjaro Linux but the process will be same for all Linux distro.
How to install go language in Manjaro Linux using pacman
First we use a simple text editor and write the program.
After that we build the program and generate the executable file using
go build filename.go
to run the executable file use the command
to give a custom name for the executable file use
go build -o customname filename.go
to run the go program without generating the executable file use the command
go run filename.go