thrift/thrift-gen/names.go
func camelCase(name string, publicName bool) string {
	parts := strings.Split(name, "_")
	startAt := 1
	if publicName {
		startAt = 0
	}
	for i := startAt; i < len(parts); i++ {
		name := parts[i]
		if name == "" {
			continue
		}

		// For all words except the first, if the first letter of the word is
		// uppercase, Thrift keeps the underscore.
		if i > 0 && strings.ToUpper(name[0:1]) == name[0:1] {
			name = "_" + name
		} else {
			name = strings.ToUpper(name[0:1]) + name[1:]
		}

		if isInitialism := commonInitialisms[strings.ToUpper(name)]; isInitialism {
			name = strings.ToUpper(name)
		}

		parts[i] = name
	}
	return strings.Join(parts, "")
}
func camelCase(name string, publicName bool) string {
	parts := strings.Split(name, "_")
	startAt := 1
	if publicName {
		startAt = 0
	}
	for i := startAt; i < len(parts); i++ {
		name := parts[i]
		if name == "" {
			continue
		}

		// For all words except the first, if the first letter of the word is
		// uppercase, Thrift keeps the underscore.
		if i > 0 && strings.ToUpper(name[0:1]) == name[0:1] {
			name = "_" + name
		} else {
			name = strings.ToUpper(name[0:1]) + name[1:]
		}

		if isInitialism := commonInitialisms[strings.ToUpper(name)]; isInitialism {
			name = strings.ToUpper(name)
		}

		parts[i] = name
	}
	return strings.Join(parts, "")
}
// camelCase takes a name with underscores such as my_arg and returns camelCase (e.g. myArg).
// if publicName is true, then it returns UpperCamelCase.
// This method will also fix common initialisms (e.g. ID, API, etc).