Last 12 weeks · 0 commits
2 of 6 standards met
Repository: fatih/camelcase. Description: Split a camelcase word into a slice of words in Go Stars: 183, Forks: 26. Primary language: Go. Languages: Go (100%). License: MIT. Homepage: http://godoc.org/github.com/fatih/camelcase Latest release: v1.0.0 (7y ago). Open PRs: 1, open issues: 0. Last activity: 5y ago. Community health: 42%. Top contributors: fatih, petemoore, dvrkps.
@fatih When ranging over a string, the index does not necessarily increase by one byte with each iteration. For example, see https://play.golang.org/p/ATNWjRKS4f. This means expressions like are invalid if previous rune is more than one byte in size (it will represent previous byte, not previous rune). This fix reads the string into an array of runes, and operates on that, rather than the underlying bytes of the string directly. I've added a test to demonstrate the fix. I've also switched the tests to being an example - so the split test cases don't need to be duplicated in the function comment, since they will be shown as an example in the go docs.