package bob import ( "strings" "unicode" ) const testVersion = 2 func Hey(s string) string { s = strings.TrimSpace(s) var hasUpper bool var hasLower bool for _, r := range s { switch { case unicode.IsUpper(r): hasUpper = true case unicode.IsLower(r): hasLower = true } } switch { case hasUpper && !hasLower: return "Whoa, chill out!" case strings.HasSuffix(s, "?"): return "Sure." case len(s) == 0: return "Fine. Be that way!" default: return "Whatever." } }