Recently I became docker advocate for out teams here in Pune, if you are thinking what does it actually mean, well I have to ramble about how cool docker is and how can we use it for our advantage till person / team across me says “Alright ! We get it, docker is awesome, lets use it” 🙂
One curious thing that I found while my travels through dockerized world of container as service is docker is written in new language around the corner – Go Lang. Creators of Docker intentionally chose to wrote docker in Go. There are some nice articles that answer typical questions like why and how, but I wanted to personally take a closer look at Go-lang and decide for myself.
As always first step is Initiation and for that I wanted to setup go lang on mac + IDE. Here is roundup of all that worked for me (In short here is how you setup Go Lang and IDE for the same in 10 minutes):
- Install GO Lang for Mac, package is available at https://golang.org/dl/
- Setup GOPATH – On Mac, I simply added export GOPATH in my bash_profile like this
- export GOPATH=$HOME/sid-projects/go-workdir
- Download and Install Atom editor for mac from https://atom.io/download/mac
- Open preferences for Atom -> +Install, Install following packages:
- go-plus – This will install everything needed for Atom – GO integration.
- autocomplete-go – For obvious purpose, if not installed already, install this ASAP 😉
- Platformio Ide Terminal – This will install terminal so that you’ll be able to run code directly through Atom editor
- After each package install, restart Atom.
- If any of those packages have dependencies, you’ll be prompted to take action, it’s just a matter of clicking through all “Yes” buttons.
- After final restart of Atom, It’s time to Point your Atom editor to project location.
- File -> Add Project Folder will allow you to point to project directory that you want to use.
- Create new file hello.go like this:
- IF it fails to auto complete, like in my case, it actually gave me warning that some native modules needed to be rebuilt, once you do that, restart Atom and you’ll have all the auto complete that you want!
Thanks it folks, It cannot get easier than this, so far I have loved Atom + GO Lang integration, as I progress through learning through GO, I’ll add more on this topic.