Go Installation

Go Language Installation

INSTALLATION DETAILS FOR ALL OPERATING SYSTEMS

Download Go Installable file:

Download the latest version of Go installable fileaccording to your operating system from the official site..

go language support os
Notepad

NOTE : Go language can be installed only on 64 bit operating systems

Installation on UNIX/Linux/Mac OS X and FreeBSD

Extract the downloaded archive into the folder /usr/local, creating a Go tree in /usr/local/go. For example: tar –C/usr/local –xzf go 1.4.linux-amd64.tar.gz. Add /usr/local/go/bin to the PATH environment variable.

go language installation directories

Installation on Windows

Use the MSI file and follow the prompts to install the Go tools. By default, the installer uses the Go distribution in C:\Go. The installer should set the C:\Go\bindirectory in Window's PATH environment variable. Restart any open command prompts for the change to take effect.

Verify Go Installation and Configuration Open Command Prompt and execute the command “go version “to verify go installation.

go language check version

Execute the command “go env “to verify go configuration. GOPATH should point to the workspace.

go language check env

Testing Go Installation

To checkwhether the installation is successful or not. We can write a simple Hello World program and execute it.

Where to write the code?

We can use any text editors like Notepad, Notepad++,Brief, Epsilon, EMACS, vim or vi etc. However, there are several limitations in plain text editors. We can use tools like Visual Studio Code for rapid code development.

The files contain program source code are calledGo program source files and are typically named with the extension “.go”.Create a go file named “test.go”in C:>Go_WorkSpace.

CODE/PROGRAM/EXAMPLE
package main
import "fmt"
func main(){
	fmt.Println("Hello, World!")
	}

Running the Go file:

Open a command prompt/terminal and execute the command run “test.go”to see the result

Syntax
C:\Go_WorkSpace>go run test.go

Output : Hello, World!

#Go_Language_Installation #install_go #install_golang #install_go_ubuntu #install_go_on_ubuntu #install_go_in_ubuntu #golang_install_ubuntu #golang_Installation_on_Windows

(New page will open, for Comment)

Not yet commented...