Teaching Myself Go(golang) – Part 2 Hello World

Every file in Go must start with a package line, The binary that you would want to run would be called package main (I notice the first similarity with C). So I hash out my first bare golang program go1.go : package main func main(){ } At this point I start noticing some stuff thats borrowed from python like no end of line charachter (; in C, Perl etc.). Personally given my heavy Perl background I like to write commands in multi level lines in Perl and I think its a better option than writing a long command in a single line, so this is not really my favourite feature. But to each his own. Anyway this is not exactly like Python, because you can put a semi colon at the end if you wish to. So in a way it tries to accomadate people with either kind of preference vis-a-vis EOLs. Now I run my program with with: go run go1.go It runs fine. and there are no errors. Next I fill it up with hello world logic, but now the whole packaging system comes into play, to use any function in go you need to import the package that provides the function. In this case we need Println for printing a line and its exported by fmt. package main import "fmt" func main(){   fmt.Println("Hello World") } Viola it churns out Hello World for me!...

Teaching Myself Go(golang) – Part 1 Installing and Configuring

First things first, my base system is a Ubuntu 12.04.2 32 bit desktop. First I install Go sudo apt-get install golang-go It’s interesting how this system works, it prompts me to verify if I want to report my install to the godashboard.appspot.com server! I am impressed! I notice a new idea even before I start working with this language. The entire install comes up to 79.6 Mb on my Laptop. Thats it, everything is installed! Gotta love the debian packaging...

Go Programming Language

So today I decided to teach myself Go. Reason it has triggered my interest is that I have been looking at UPnP digital media server implementations in various languages. In fact I even have my own in progress project on that in git hub ‘perl-dlna-server’. I noticed that the pydlnadms a Python project for a dlna server was moved to go as dms. Now from my experience long term python programmers are quiet loyal to their source language so its has gotten me inquisitive about this language. Go also referred to as golang was developed by Robert Griesemer, Rob Pike and Ken Thompson at Google in 2007. It’s a statically typed language with syntax loosely derived from C. As far as programming languages go this one is very young. It was first announced in November 2009 and its currently used to power some of Google’s production systems. More updates...