Thursday, August 15, 2013

Installing and Configuring Go

In preparation for a few beginner workshops, I created videos for people to follow to install and configure the Go development tools. Just adding them here.

On Mac OSX:

On Ubuntu Linux:

The steps that I've followed are pretty much this (with my username 'vj'):
  • Download the zip or .tar.gz file for your platform from
  • Create a folder called golang wherever you prefer. I prefer to have it in my home folder like so: /home/vj/coding/golang since I want to keep all my programming language folders in a "coding" folder in my home dir.
  • Extract the .zip or .tar.gz file you downloaded earlier. It will contain a single "go" folder. Move this into your golang folder. So you will now have something similar to /home/vj/coding/golang/go
  • Append the path to the go command line tools (/home/vj/coding/golang/go/bin) to your $PATH. On Ubuntu in my bash shell, to ~/.bashrc I added the entry export PATH=$PATH:/home/vj/coding/golang/go/bin
  • I created one new folder in the golang folder called gopath". The Go tools will have use for this path later to download and install external packages.
  • Add two additional entries to your .bashrc, export GOROOT=/home/vj/coding/golang/go and export GOPATH=/home/vj/coding/golang/gopath
  • Source the .bashrc if required so that the environment variables are available in your current shell, or restart the shell.

With that you should now be ready to compile and run your go programs. Note that you don't need any special editors or IDEs to work with Go. All your regular text editors will work.
The process to be followed for Windows is pretty much the same. You can have your golang folder as c:/coding/golang and add your environment variables as you would normally do on windows: right click My Computer -> Click Properties -> Click Advanced System Settings -> Click Environment Variables. Add new GOROOT and GOPATH values, and append the required value to the Path variable.


  1. Kudos!!! for creating such a great education site.

  2. I'm a new mac user. I added the GOROOT and GOPATH environment variables when I started learning Golang few days ago. But now when I echo $GOROOT and $GOPATH it's returning blank. Also tried these steps:

    touch .bash_profile
    open -a .bash_profile
    export GOROOT=/home/my_coding_dir/coding/golang/go

    So can you explain more about these two points, in the sense that why am I seeing this behaviour?

    1) Add two additional entries to your .bashrc, export GOROOT=/home/my_coding_dir/coding/golang/go and export GOPATH=/home/my_coding_dir/coding/golang/gopath

    2) Source the .bashrc if required so that the environment variables are available in your current shell, or restart the shell.

    What am I doing wrong here?

  3. By the way this did not help either:

    touch .bashrc
    open -a .bashrc
    export GOROOT=/home/my_coding_dir/coding/golang/go

  4. For ubuntu just use...

    sudo apt-get install golang

  5. I cant wait to check out some of these blogs! I’ve really wanted to start learning more about cars and auto repairs lately and I think this will help a lot. I think it can save my family some money if we knew how to do some repairs at home.! Thanks again for all the options.

    bike spa services in mumbai
    house cleaning services in mumbai
    car wash services in mumbai

  6. It is really a great and useful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.
    Back to original

  7. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.
    Digital Marketing Company in India

  8. I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon.

    Salesforce Training in Chennai


  9. I definitely think that this should be well thought out and done in a smart way, it is important to get out there and market your business.

    This is a great information and examples, thanks for sharing!

    digitalbrief exchange digital marketing

  10. Big Data and Data Science Course Material. Avail 15 Day Free Trial! Learn Flume, Sqoop, Pig, Hive, MapReduce, Yarn & More. Get Certified By Experts!
    android app development training

  11. Thank you for sharing them! I hope you will continue to have similar posts to share with everyone!
    html color

  12. Thanks for your article! I have been looking for quite a long time and fortunately I read this article! I wish you would continue to have valuable articles like this or more to share with everyone!

  13. Really Good blog post.provided a helpful information about how to install and configure golang .keep updating...
    Digital marketing company in Chennai

  14. I hope you will continue to have similar posts to share with everyone!

  15. Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much

    Installment loans
    Payday loans
    Title loans
    Cash Advances

  16. I hope you will continue to have similar posts to share with everyone!

  17. I enjoyed over read your blog post. Your blog have nice information, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again
    FRIV 8 & FRIV 8 Games
    Friv 9 - Friv - Friv Games

  18. I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.

  19. Your article is awesome! How long does it take to complete this article? I have read through other blogs, but they are cumbersome and confusing. I hope you continue to have such quality articles to share with everyone! I believe there will be many people who share my views when they read this article from you!
    vex 3

  20. Really Good blog post.provided a helpful information about installing and configuring go.I hope that you will post more updates like this.
    MSBI Training in Chennai

  21. I like your post. It really useful with me. Thanks for sharing these useful information!

  22. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic.

    Pawn Shop

    Pawn Loans

    Pawn Shops

    Pawn Loan

    Pawn Shop near me

  23. Thanks for the information you shared. Please share useful information with your friends regularly

  24. I was very impressed by this post, this site has always been pleasant news. Thank you very much for such an interesting post. Keep working, great job! In my free time, I like play game: What about you?

  25. This is a great article. It gave me a lot of useful information. thank you very much.

  26. Thank you, so Much admin have a nice day :) you information about weight loss is very easy and simple.

  27. Thank you very much for the information you shared, it’s all I’ve been looking for

  28. I realize that nothing is fair but I'm still trying. I just want to do my best and what is possible


If you think others also will find these tutorials useful, kindly "+1" it above and mention the link in your own blogs, responses, and entries on the net so that others also may reach here. Thank you.