code: func removeTrailingInvalid(runes []rune) []rune {
  	valid := len(runes) - 1
  	for ; valid >= 0 && !validIdentifier(runes[valid]); valid-- {
  	}
  
  	return runes[0 : valid+1]
  }
docs: // removeTrailingInvalid removes trailing invalid identifiers from runes.