Go is a programming language generally referenced as ‘golang’ because ‘go’ brings numerous results in search engines. You can learn more at https://golang.org.
Go is the language used in the Decred Project and is a prerequisite for virtually all source code made available by developers, as well as for some tools only available in source code. This article shows the step-by-step installation of Go and will be referenced whenever Go is a prerequisite.
This installation is not required for Decrediton or Decred binaries users.
2. Installing the Go tools
To compile the source code of the components of Decred Project, it is necessary at the moment to have at least Go 1.8 or 1.9 installed. Unfortunately, via apt-get it is only possible to install version 1.7. If in the future the official repository make available the version that we need, the installation will be easier using:
$ sudo apt-get install golang
Until then, the installation needs to be done manually. The following steps were performed on a Debian 9 64-bit.
$ARCH represents ‘386’, ‘amd64’, ‘arm’ or ‘arm64’.
a) Go to https://golang.org/dl/ and download Go for Linux, which will be named
b) Go to the prompt of the Downloads folder and unzip the tarball into /usr/local directory:
$ cd $HOME/Downloads $ sudo tar -C /usr/local -xzf go$VERSION.linux-$ARCH.tar.gz
c) Export Go executable path to your PATH:
$ export PATH=$PATH:/usr/local/go/bin
To set up the
PATH permanently for all users, include this command at the end of the
/etc/profile file, or at the end of
~/.bashrc for the current user only:
Next comes the installation of Dep.
3. Installing Dep
Dep is the dependency manager tool for Go. It evaluates what will be compiled, finds out what the dependencies are, checks what is locally installed, searches the repositories for what is missing, and downloads them.
The easiest way to install Dep is via Go:
$ go get -u github.com/golang/dep/cmd/dep
If it doesn’t work, the executable may be downloaded from Github.
a) Go to https://github.com/golang/dep/releases and download the release for your operating system and platform.
b) Configure the execution attribute:
$ chmod +x dep_$VERSION
c) Suggestion: Move Dep to the same directory as Go executable:
$ mv dep_$VERSION /usr/local/go/bin/dep