Skip to content

Instantly share code, notes, and snippets.

@diki-haryadi
Last active September 18, 2021 05:09
Show Gist options
  • Save diki-haryadi/f035772f5f3461e4b9b0d382e922954f to your computer and use it in GitHub Desktop.
Save diki-haryadi/f035772f5f3461e4b9b0d382e922954f to your computer and use it in GitHub Desktop.
Install and Config Golang ubuntu

Ubuntu 20.04

Download

$ wget https://golang.org/dl/go1.17.1.linux-amd64.tar.gz

$ sudo tar -xvf go1.16.4.linux-amd64.tar.gz
$ sudo mv go /usr/local

config Bashrc

nano ~/.bashrc or ~/.profile
$ export GOROOT=/usr/local/go
$ export GOPATH=$HOME/go
$ export PATH=$PATH:$GOPATH/bin:$GOROOT/bin
$ mkdir $HOME bin pkg src
$ source ~/.bashrc
$ go version 

Disable go modules on golang

$ export GO111MODULE=off

Check Environment

$ go env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment