Go with Atom for Go-Lang

August 15, 2016    atom atom-go-editor go go-editor go-lang

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):

  1. Install GO Lang for Mac, package is available at https://golang.org/dl/
  2. Setup GOPATH – On Mac, I simply added export GOPATH in my bash_profile like this
    • export GOPATH=$HOME/sid-projects/go-workdir
  3. Download and Install Atom editor for mac fromĀ https://atom.io/download/mac
  4. 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.
  5. 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.
  6. 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.
  7. Create new file hello.goĀ like this: Ā  Ā Atom-Go
  8. 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.

comments powered by Disqus