code: func downcaseAndDash(input string) string {
  	ret := make([]rune, 0)
  	lastUpper := false
  	nextUpper := false
  	for i, chr := range input {
  		if i+1 < len(input) {
  			nextUpper = unicode.IsUpper(rune(input[i+1]))
  		}
  		if unicode.IsUpper(chr) {
  			if len(ret) == 0 || (lastUpper && nextUpper) {
  				ret = append(ret, unicode.ToLower(chr))
  			} else {
  				ret = append(ret, '-', unicode.ToLower(chr))
  			}
  			lastUpper = true
  		} else {
  			ret = append(ret, chr)
  			lastUpper = false
  		}
  	}
  	return string(ret)
  }
docs: // downcaseAndDash converts a field name (expected to be camel case) to an all
  // lower case flag name with dashes between words that were previously cameled.
  // It attempts to handle upper case acronyms properly as well.