DEV Community

Saravanan Gnanaguru
Saravanan Gnanaguru

Posted on • Edited on • Originally published at github.com

3 2

Getting Started with Go in Ubuntu 16.04

Golang (or simply Go) setup and getting started

Following instructions are verified setup of Go on Ubuntu 16.04 version

Install Go

  • Get the OS specific installer from here
  • Run the command as root user or sudo
  • Extract go executable in /usr/local directory
  • Execute the below commands (Go version 1.14.1 used in this example)
cd /usr/local/
wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz
tar -xvzf go1.14.1.linux-amd64.tar.gz 
rm go1.14.1.linux-amd64.tar.gz 
Enter fullscreen mode Exit fullscreen mode

Setup Go development environment

  • Create directories for development

mkdir -p $HOME/go/{bin,src,pkg}

Where,
bin - directory to hold the go source executable
src - source directory in which all the source modules will be coded
pkg - directory to hold the dependency import packages

  • Add path to environment permanently by adding in .profile
export "PATH=$PATH:/usr/local/go/bin"
export "GOPATH=$HOME/go"
export "GOBIN=$GOPATH/bin"
Enter fullscreen mode Exit fullscreen mode
  • Execute .profile file to make effect of Environment variable updates
source ~/.profile
Enter fullscreen mode Exit fullscreen mode

Verify the installation

go help
go env
Enter fullscreen mode Exit fullscreen mode

Go to src path and start development

cd $HOME/go/src
mkdir <new_go_module_name>
Enter fullscreen mode Exit fullscreen mode

Bibliography

https://www.tecmint.com/install-go-in-linux/

https://golang.org/doc/install

https://github.com/golang/go/wiki/SettingGOPATH

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more