If you’re looking to play a little with Go, you should check out the Go Playground which lets you run code online without having to install anything. This is also the most common way to share Go code when seeking help in Go’s discussion forum and places like StackOverflow.
Installing Go is straightforward. You can install it from source, but I suggest you use one of the pre-compiled binaries.
When you go to the download page, you’ll see installers for various platforms. Let’s avoid these and learn how to set
up Go ourselves. As you’ll see, it isn’t hard.
Except for simple examples, Go is designed to work when your code is inside a workspace. The workspace is a folder
composed of bin, pkg and src subfolders. You might be tempted to force Go to follow your own style – don’t.
Normally, I put my projects inside of ~/code. For example, ~/code/blog contains my blog. For Go, my workspace is
~/code/go and my Go-powered blog would be in ~/code/go/src/blog.
In short, create a go folder with a src subfolder wherever you expect to put your projects.