func ToUpperCamelCaseASCII(s string) string {
	if s == "" {
		return ""
	}
	upper := true
	start := 0
	result := make([]byte, 0, len(s))
	var initialism []byte
	for i := 0; i < len(s); i++ {
		c := s[i]
		if c == '_' {
			upper = true
			candidate := result[start:]
			initialism = initialism[:0]
			for _, b := range candidate {
				initialism = append(initialism, toUpperASCII(b))
			}
			if length := commonInitialism.LookupByBytes(initialism); length > 0 {
				result = append(result[:start], initialism...)
			}
			start = len(result)
			continue
		}
		if upper {
			result = append(result, toUpperASCII(c))
			upper = false
			continue
		}
		result = append(result, c)
	}
	candidate := result[start:]
	initialism = initialism[:0]
	for _, b := range candidate {
		initialism = append(initialism, toUpperASCII(b))
	}
	if length := commonInitialism.LookupByBytes(initialism); length > 0 {
		result = append(result[:start], initialism...)
	}
	return string(result)
}
ToUpperCamelCaseASCII is similar to ToUpperCamelCase, but optimized for
only the ASCII characters.
ToUpperCamelCaseASCII is faster than ToUpperCamelCase, but doesn't work if
contains non-ASCII characters.
package stringutil
import (
	"sync"
	"unicode"
	"unicode/utf8"
)
var (
	mu sync.Mutex
	commonInitialismMap = map[string]struct{}{
		"API":   struct{}{},
		"ASCII": struct{}{},
		"CPU":   struct{}{},
		"CSRF":  struct{}{},
		"CSS":   struct{}{},
		"DNS":   struct{}{},
		"EOF":   struct{}{},
		"GUID":  struct{}{},
		"HTML":  struct{}{},
		"HTTP":  struct{}{},
		"HTTPS": struct{}{},
		"ID":    struct{}{},
		"IP":    struct{}{},
		"JSON":  struct{}{},
		"LHS":   struct{}{},
		"QPS":   struct{}{},
		"RAM":   struct{}{},
		"RHS":   struct{}{},
		"RPC":   struct{}{},
		"SLA":   struct{}{},
		"SMTP":  struct{}{},
		"SQL":   struct{}{},
		"SSH":   struct{}{},
		"TCP":   struct{}{},
		"TLS":   struct{}{},
		"TTL":   struct{}{},
		"UDP":   struct{}{},
		"UI":    struct{}{},
		"UID":   struct{}{},
		"UUID":  struct{}{},
		"URI":   struct{}{},
		"URL":   struct{}{},
		"UTF8":  struct{}{},
		"VM":    struct{}{},
		"XML":   struct{}{},
		"XSRF":  struct{}{},
		"XSS":   struct{}{},
	}
	commonInitialisms = keys(commonInitialismMap)
	commonInitialism  = mustDoubleArray(newDoubleArray(commonInitialisms))
	longestLen        = longestLength(commonInitialisms)
	shortestLen       = shortestLength(commonInitialisms, longestLen)
)
func ToUpperCamelCase(s string) string {
	if s == "" {
		return ""
	}
	upper := true
	start := 0
	result := make([]byte, 0, len(s))
	var runeBuf [utf8.UTFMax]byte
	var initialism []byte
	for _, c := range s {
		if c == '_' {
			upper = true
			candidate := string(result[start:])
			initialism = initialism[:0]
			for _, r := range candidate {
				if r < utf8.RuneSelf {
					initialism = append(initialism, toUpperASCII(byte(r)))
				} else {
					n := utf8.EncodeRune(runeBuf[:], unicode.ToUpper(r))
					initialism = append(initialism, runeBuf[:n]...)
				}
			}
			if length := commonInitialism.LookupByBytes(initialism); length > 0 {
				result = append(result[:start], initialism...)
			}
			start = len(result)
			continue
		}
		if upper {
			if c < utf8.RuneSelf {
				result = append(result, toUpperASCII(byte(c)))
			} else {
				n := utf8.EncodeRune(runeBuf[:], unicode.ToUpper(c))
				result = append(result, runeBuf[:n]...)
			}
			upper = false
			continue
		}
		if c < utf8.RuneSelf {
			result = append(result, byte(c))
		} else {
			n := utf8.EncodeRune(runeBuf[:], c)
			result = append(result, runeBuf[:n]...)
		}
	}
	candidate := string(result[start:])
	initialism = initialism[:0]
	for _, r := range candidate {
		if r < utf8.RuneSelf {
			initialism = append(initialism, toUpperASCII(byte(r)))
		} else {
			n := utf8.EncodeRune(runeBuf[:], unicode.ToUpper(r))
			initialism = append(initialism, runeBuf[:n]...)
		}
	}
	if length := commonInitialism.LookupByBytes(initialism); length > 0 {
		result = append(result[:start], initialism...)
	}
	return string(result)
}