I had intended to read up on Google’s Go language when I decided to Take the Tour. It is a nice walk through and along the way I encountered a few coding exercises. Not really intending to spend too much time with the tour I decided to give some of them a quick try. Three example solutions shown below are what I came up with going through the material.
The full text of my solution for the Slices exercise.
The full text of my solution for the Maps exercise.
The full text of my solution for the Stringers exercise.
Full Source Code
The full source code files are available on GitHub @ michaelgautier/codeexpo/taking_google_go_tour_201504.
Thoughts on Google Go
First impressions is it is a solid language. I actually like it. I have a sense that it is going to do very well in the future. I am not quite ready to invest in it at this point although I will periodically read up on it. The online exercises was a good way for me to understand how the language operates. It is very straight forward. The only gotcha I ran into was converting byte array elements to strings. After about 30 minutes of thought and looking through some of Go’s standard library functions I came up with a solution.
The language designers did a fairly good job with the design. It works quite well in a hand editing scenario. The biggest improvements would be in the availability of very up-to-date manuals, tutorials, and specifications all in PDF format. More consistency in certain areas of syntax such as either required or optional parenthesis for import statements. Better clarification on the differences between optional parenthesis in if statements versus for loops. Minor things like, but in terms of major issues, I do not see any at this time.