Skip to content

Go Rewrite: Getting Started

Vincent Chen edited this page Jul 2, 2019 · 1 revision

Dependencies

  • go 1.12 or higher
  • That's it (for now)

OS

go has good support for every OS, you should have no trouble finding a binary for a relatively modern OS.

Setup

  1. Make a gocode directory. I recommend mkdir ~/.gocode so it's out of the way. This will be your $GOPATH.

  2. Find where go is installed using whereis go. You want to use the one that's a directory. In the following example, /usr/lib/go would be your $GOROOT.

$ whereis go
go: /usr/bin/go /usr/lib/go /usr/lib/go/bin/go

$ file /usr/lib/go
/usr/lib/go: directory
  1. Set your exports in your shell's rc file:
export GOROOT="{see above}"
export GOPATH="{see above}"
  1. Get the repo and dependencies
mkdir $HOME
git clone {this repo} && cd {this repo}
go get
  1. That's it!

But... why?

go comes with a very clean and powerful standard toolkit, making it easier to wrangle dependencies for small-medium scale projects so you can focus on coding.

The default dependency management tool is go mod and uses 2 files: go.mod (the dependencies) and go.sum (a checksum to verify dependencies).

Do not change dependencies unless you know what you're doing!

glhf; ping me in Discord (YourselfAU) if you're actually interested in contributing and somehow have the time for it.

Clone this wiki locally