Go lang on OS X (lion)

Recently I’ve moved from linux to OS X, yep I’m using a so-called “hackintosh”.   Having spent the past week learning how to live in the environment, which for the record I really live, it’s time to hack some Go!

Prerequisites

As the Go lang site says, you need Xcode installed first off, so head off and find Xcode in App Store and install it.

Additionally I’ve installed and used MacPorts, primarily because I wanted some other unix tools but I’ve also used it to install Mercurial. To install mercurial open a terminal and run the following command :

sudo port install mercurial

Get the Go sources

As the Go lang getting started page shows, you can use mercurial to download the sources:

 hg clone -u release https://go.googlecode.com/hg/ go

And build it :

cd go/src
./all.bash

That’s about it, as long as you see that all tests have passed.  Of course you probably want to edit your .bashrc to include your local environmental variables but that’s been documented many times before.

 

Posted in Uncategorized | Tagged | 2 Comments

Golang FilePoller fspoll

When using the template package one doesn’t want to read the templates from the file system every time they are used.  Likewise you want to restart the process just to test some minor change within the template.

Go’s os/inotify package creates a file watcher, but it only supports Linux, and in the spirit of keeping my Go app portable I’ve created a simple File Poller.

Continue reading

Posted in golang | 5 Comments

Fix for Unmarshal structs that contain slices merged into gomongo

With thanks to mikejs, again, for fixing gomongo.

As mentioned previously there was a bug with the gomongo package that caused structs that contained slices not to Unmarshal correctally.

Continue reading

Posted in golang | Leave a comment

GOAuth command Line example

At last…

…I’ve added an example to the GOAuth pages!

It’s a very trivial example, but should be sufficient to get to grips with the package.

Continue reading

Posted in golang | Leave a comment

gomongo Unmarshal issues with types that contain slices

There’s been an issue with the gomongo that I’ve been aware of for a while and I’ve just found a fix for it.

If you were to take the example that I created here:-
- http://go.hokapoka.com/golang/mongodb-golang-gomongo/

Continue reading

Posted in golang, mondoDB | Leave a comment