You can download the version of golang for your operating system here. Make sure you select thecorrect system type i.e. 32 or 64 bit else you run into issues down the line.
Make sure your:
GOPATH
environment variable is pointing to the proper directory where your go projects live.GOROOT
is pointed to the place where you installed go. If you are unsure you can use the commandwhich go
to get the path
Each folder will contain a main.go
file. You can run this file using the go cli
and running go run <path to main.go>
or compiling first using go build <path to main.go>
.
If you are building the binary using go build
you will need to run the generated executable
manually. It should be located in the same folder as your main.go
file, but if it's not there
check your GOROOT/bin
folder.
Clone this repo and view locally in a text editor or IDE instead of browsing through github so you don't need to navigate in and out of many different pages.