Sha256: ae24abf60eac589629c4bf923d2146b95e42c212ec0cfe040dc7d8583903a3b7
Contents?: true
Size: 579 Bytes
Versions: 158
Compression:
Stored size: 579 Bytes
Contents
package bob import "strings" const testVersion = 2 func Hey(drivel string) string { switch drivel = strings.TrimSpace(drivel); { case silent(drivel): return "Fine. Be that way!" case yelling(drivel): return "Whoa, chill out!" case asking(drivel): return "Sure." default: return "Whatever." } } func yelling(drivel string) bool { return strings.ToUpper(drivel) == drivel && strings.ToLower(drivel) != strings.ToUpper(drivel) } func asking(drivel string) bool { return strings.HasSuffix(drivel, "?") } func silent(drivel string) bool { return drivel == "" }
Version data entries
158 entries across 158 versions & 1 rubygems