added documentation and did some slight restructuring. it's party time.

This commit is contained in:
Andrew Gallant (Ocelot)
2012-05-06 02:21:31 -04:00
parent 99bc76de54
commit 18b2d420b0
11 changed files with 284 additions and 304 deletions

View File

@@ -7,7 +7,7 @@ import (
// AllCaps is a regex to test if a string identifier is made of
// all upper case letters.
var AllCaps = regexp.MustCompile("^[A-Z0-9]+$")
var allCaps = regexp.MustCompile("^[A-Z0-9]+$")
// popCount counts number of bits 'set' in mask.
func popCount(mask uint) uint {
@@ -30,7 +30,7 @@ func pad(n int) int {
// first letter of each chunk, and smushes'em back together.
func splitAndTitle(s string) string {
// If the string is all caps, lower it and capitalize first letter.
if AllCaps.MatchString(s) {
if allCaps.MatchString(s) {
return strings.Title(strings.ToLower(s))
}