Installing go lang on OS X Yosemite
Go lang has been getting a lot of attention not only from software developers but web developers too. In the past year I have seen a lot of fellow developers switch from Python to GO or Java to GO. I myself have started learning go so yes you can expect a lot of Go Lang tutorials and articles coming up in 2016. First things first, Before we can learn it together we need to install go lang. So In this article we are going to the install go lang on a Mac machine running on OS X Yosemite.
Installing Go Lang on OS X Yosemite
Go lang provides installer packages for all major operating systems including Mac OS X > 10.
- So the first thing we are going to do is to download the go lang installer package from the official go lang website‘s download page. The current stable version (as of this writing) is 1.5.2 so we are going to download the go1.5.2.darwin-amd64.pkgÂ file.
- Once the packaged file has been downloaded just double click to open it.
- This will open the Go Installer that will guide you through the installation steps. (the go lang installer will prompt you for yourÂ password in order to write the go lang files to the disk.)
- Once you are finished with the installer processes you will see an image just like the one above.
- Now we will confirm our go installation by writing a simple go script and compiling and running it to see its output. So open up the terminal and navigate to the path where you would like to test the go lang installation. (For e.g. /user/username/goprojects/install/test/)
- Now create a file
test.goat the location using your favourite text editor and add the following code to it.
- Now simply run the file using the command
go run test.go. This will compile and run your code. If you see “Hello World!” as the output then you have successfully installed go. In case you are facing issues, Please leave a comment below.
Now you are all set to write your first go program. 🙂