Go to Go - An Introduction to Go language01 Mar 2014
I also heard about some good languages coming out of womb, some looked very promising like go, elixir(runs on Erlang virtual machine) and julia. I started exploring, because of my curiousity and really hooked to them. Go is one of them that I also dared to use in production, and to my surprize it kept its promise. This special series will cover go language(from whichever perspective).
Go is a C like language, developed with keeping current system requirements and capabilities in mind, it has a robust memory management, garbage colletion, concurrency(via goroutine or coroutines actually). If you would like to read into details look into Go and wiki. It is not a OOPS language as paradigm is sifting back to functional and imperative languages.
Go get package for your operating system and install it from here, export go executables to path.
you should be able to check if go has installed correctly by typing following in console
Now next step is to setup a
GOPATH, GOPATH is a directory where all go code dependencies; that one installs, resides. It also contains go projects that one builds. So
GOPATH has to be set before we move on.
Let’s set it up somewhat like this in bash profile
Every go project has a directory layout, as mentioned below
Go also has a very interesting third party packages integration tool called
go get. It also detects popular vcs tools like git and integrates well with github. Here is an example for getting mongodb driver called
Now we are all set. So let’s start with our first code. Navigate to GOPATH directory under
src create a new directory, name it
hello_gopher and then make a file called
Happy Coding ;)