Setup and Install Go Development Environment on Ubuntu/Debian

Exported on 28-Sep-2021 13:43:12

Install GO Programming Language On Ubuntu With AttuneOps

This Blueprint Configures GO Programming Development Environment on Ubuntu

Go is an open-source programming language focused on simplicity, reliability, and efficiency. Go was originally built for programs related to networking and infrastructure. It was intended to replace popular high-performance server-side languages like Java and C++.

Go is fast, statically typed, compiled language that feels like a dynamically typed, interpreted language. Go is used for following purposes: - Web development (server-side) - Developing network-based programs - Developing cross-platform enterprise applications - Cloud-native development

Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Linux node for the host you wish to install the stack on.
  2. On the Inputs tab, create Linux credentials to connect to the host you wish to install the stack on.
Steps Involved
  • Download Go
  • Install Go
  • Configure path and verify installation

Parameters

Name Type Script Reference Default Value Comment
Linux Node Linux / Unix Server linuxNode
Linux User Linux OS Credential linuxUser

1 - Download Go Package

Downloads binary release for go version 16.6.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Downloads v16.6 of go
curl -O https://storage.googleapis.com/golang/go1.16.6.linux-amd64.tar.gz

2 - Unpack go package

Unpacks the release package.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Unpack tar file
tar -xzf go1.16.6.linux-amd64.tar.gz

3 - Configure go path

Configures system path to include go executable.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Move to /usr/local dir
sudo mv go /usr/local

# Add go to path
echo 'export GOPATH=$HOME/work' >> ~/.profile 
echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.profile

source ~/.profile

4 - Verify Installation

Verifies installation by printing installed go version.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# View go version
go version