kylelemons/go-gypsy — pull request #10 by wellle (2013-01-25 11:43:32+00:00)
Title: parser should only split on colons followed by a space

We are using a fork of your yaml parser and I ran into a problem with the following yaml snippet:

url: http://www.example.com

I noticed that your parser splits on the colon in the url `http://www.example.com`, leading to the following structure:

url:
http: //www.example.com

Quoting [Wikipedia](http://en.wikipedia.org/wiki/YAML#Syntax): **YAML requires that colons** and commas used as list separators **be followed by a space** so that scalar values containing embedded punctuation (such as 5,280 or http://www.wikipedia.org) can generally be represented without needing to be enclosed in quotes.

I added a small fix to `getType` in `parser.go`: In case of a colon, we look at the following character and only split on the colon if we find a space after. It's not the most beautiful fix but it solved our issue and I thought I'd share.