metaleap/go-xsd — pull request #3 by shurcooL (2013-08-25 23:15:33+00:00)
Title: Fix ListValues() "slice bounds out of range" panic on empty string input.

It will still panic if given a non-empty string consisting of only whitespace.

I don't know the exact business requirements for this function, but I'm pretty sure it can be rewritten to make use of Go's standard library (e.g. http://golang.org/pkg/strings/ has funcs like Trim(), TrimLeft(), TrimLeftFunc(), Split(), etc.) to be much more concise, easier to understand and maintain, and less error-prone.

Perhaps the whole ListValues() func can be replaced with something along the lines of:

```go
return strings.Split(strings.Trim(v, " \r\n\t"), " ")
```

Or slightly more verbose depending on the exact business requirements.