Golang: Dev environment setup in Ubuntu 16.04
Contents
- Setup Go runtime in Ubuntu 16.04
- Configure VS Code for Golang
Setup Go runtime in Ubuntu 16.04
- Download Go for Linux
- Open Terminal
- Go to ‘Downloads’ folder
cd Downloads
- Extract the downloaded Go archive in
/usr/local
tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz
- Update
PATH
environment variable
nano $HOME/.profile
- Append
export PATH=$PATH:/usr/local/go/bin
to this file
- Restart computer
- Type
go
in terminal to check if the installation was successful
- Expected output
Go is a tool for managing Go source code
- Open VS Code
- Go to View -> Extensions
- Type
go
in the search bar
- Install the extension provided by Microsoft with over 4Mn downloads
- Restart VS Code
- Open a new file
- Select the
Plain Text
option at the bottom right corner of the screen
- Modify it to
Go
language
- Select the
Analysis Tools Missing
option at the bottom right corner of the screen
- Select Install