Cloud9 already supports the Go environment setup. When you build your Cloud9 workspace, it will detect your project as Go project and setup a machine pre-configured with Go build tools. But, it will be an older version of Go. Since Cloud9 gives you access to terminal access to a linux machine, that is not a problem, follow the next steps to get your Go environment up to date.
Update Cloud9 IDE with latest Go (1.3.3 as of this writing)
- Open you Go lang project (from Github)
- Open your Cloud9 terminal in workspace for your Go project.
- Get URL URL for Go download for linux-amd64
- From terminal, check location where Go binaries are installed
- $> which go
- Make note of the location where Go is installed. For instance if the previous command returns /opt/go/bin/go, this means Go’s install directory is the /opt/ directory.
- Extract the archive in the into the install directory to overlay the previous install.
- sudo tar -C /opt/ -xvf go1.3.3.linux-amd64.tar.gz
- Adjust command for respective version downloaded.
- Test installation
- $> go version
- Ensure your GOPATH is properly setup.
After you have upgraded you will be almost there. When you create a workspce directly from your Github project (as I did), it will not be setup like the Go workspace standard (with src/github/username, etc). Echo $GOPATH to see where the current workspace is located (it will be pointing to your project's workspace directory or whatever you called the Cloud9 workspace). Use the project's terminal to move the directories around into the expected structure for Go. Done!
For a cloud-based IDE, Cloud9 seems to have many features of a modern desktop IDE. I have not explored all, but my next stop is customization. I want to run `go fmt` on save as I do in sublime.