How to install latest golang on EC2

If you are looking for simple way to upgrade yourt golang installation on EC2, you can experience error like that:

Error: Package: golang-bin-1.5.1-0.el6.x86_64 (epel)
Requires: go = 1.5.1-0.el6
Installing: golang-1.4.2-3.19.amzn1.x86_64 (amzn-main)

Because on amzn-main repo, there is an older version of golang – on epel, there is a newer. Nothing simplier just disable for a momement amzn-main repo, and install golang compeltly from epel.

sudo yum --disablerepo=amzn-main --enablerepo=epel install golang-bin