Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Stripe Mock Installer for Vagrant VM
## ============================
## Stripe Mock Install
## ============================
# The Go language is used for the Stripe Mock server
# Can't just run > "sudo apt-get install golang"
# The Ubuntu default is go v1.6 which isn't supported, you get an error about sort.Slice e.g:
# src/ undefined: sort.Slice
# As per
# the gocode folder is the workspace for doing downloads, compiles, etc..
# You might need to be sudo (root) to run the following
mkdir -p /opt/go
mkdir -p /opt/gocode
# Obviously change the user to whatever you login with, I'm using a Vagrant VM
sudo chown vagrant:vagrant /opt/
sudo chown vagrant:vagrant /opt/gocode
cd /opt/
sudo tar -xvf go1.16.4.linux-amd64.tar.gz
# Unzips to /opt/go with the binary being /opt/go/bin/go
## This only sets it for now, you also need to export these in the bash profile file e.g ~/.bashrc
export GOROOT=/opt/go
export GOPATH=/opt/gocode
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
# Finally we can install stripe-mock as per
go get -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment