You are viewing Nextmv legacy docs. ⚡️ Go to latest docs ⚡️

Sdk

Environment Setup

Set up your environment to work with Go and Nextmv tools

GitHub access

If this is your first time using GitHub you will need to add SSH keys to your GitHub account to associate it to your machine. Instructions on doing so can be found here. We manage access to our repositories using GitHub teams, generally you will be added at the beginning of your trial.

Git setup

Your ~/.gitconfig will work best if it directs git to clone repositories over ssh. Add the following to your ~/.gitconfig configuration file.

[url "git@github.com:"]
    insteadOf = https://github.com/
Copy

Go setup

To install and set up Go on your machine you have two options:

Install Go manually

Nextmv requires at least Go 1.13. You should be able to find the binaries for your target system at https://golang.org/dl/. After installing the pre-compiled packages, set the following environment variables in your ~/.bashrc, ~/.zshrc or a similar configuration file.

export GOPATH=$(go env GOPATH)
export GOROOT=$(go env GOROOT)
export GOPRIVATE=github.com/nextmv-io/*
export PATH=$PATH:$GOPATH/bin
Copy

Note that if you installed Go directly from Golang, you do not need to add exports for GOPATH or GOROOT. If you installed go via Homebrew, you will need to add those lines to ~/.zshrc. If you were using bash previously, also be sure to source ~/.zshrc by running source ~/.zshrc.

Single script install with asdf

This single script to install Go and set the environment variables makes use of bash. If you are using another shell, please read the asdf docs to make changes to the script. If you are on a Windows machine, please install WSL for Windows. You can find the installation instructions here. We recommend using Ubuntu.

set -e
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
echo '
# Install asdf
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
source ~/.bashrc
asdf plugin-add golang
asdf install golang 1.16.8
asdf global golang 1.16.8
echo '
# Go modifications for hop
export GOPATH=$(asdf where golang)/packages
export GOROOT=$(asdf where golang)/go
export GOPRIVATE=github.com/nextmv-io/*
export PATH="${PATH}:$(go env GOPATH)/bin"' >> ~/.bashrc
source ~/.bashrc
echo "SUCCESS - golang version is: $(go version)"
Copy

Go workspace

We use Go modules to setup your Nextmv app. You can learn more about them in our modules and packages section.

Go package docs

You can learn more about the Nextmv Decision Stack by setting up the Go package docs.

Page last updated

Go to on-page nav menu