How to Build and Run a Go ( golang ) Program in Linux Operating System

How to Build and Run a Go ( golang ) Program in Linux Operating System
In this tutorial you will learn how to compile / build and run a go ( golang ) program in Linux operating system.

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
https://youtu.be/F1k3_AOfMJM

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
./filename

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

Suggest:

Top 4 Programming Languages to Learn In 2019

Go As a Scripting Language in Linux

Introduction to Functional Programming in Python

Dart Programming Tutorial - Full Course

My journey from Python to Golang

There Is No Best Programming Language