go-yaml/yaml — pull request #65 by coxx (2014-12-29 14:40:30+00:00)
Title: Bug fixed: inner function inside UnmarshalYAML can be called several times

When implementing interface Unmarshaler sometimes it's useful to call inner function several times. In this case slice terrors initialized and despite the fact that there are no errors, terrors is not nil (but has zero length). Because it's safe to call len() on variable of slice type which can be nil, It's better to check `len(v) != 0` than `v != nil`.

Here is working example
https://gist.github.com/coxx/ae6bc531573d72fb4d62