Created
July 17, 2023 08:22
-
-
Save rabestro/b9e6d674a705f00fc32197afc00f65d5 to your computer and use it in GitHub Desktop.
Bob - bob.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package bob implements a solution for the bob exercise from the Exercism Go track. | |
package bob | |
// Hey takes a message as input, and returns Bob's response to that remark. | |
func Hey(message string) string { | |
remark := newRemark(message) | |
switch { | |
case remark.isSilence(): | |
return "Fine. Be that way!" | |
case remark.isExasperated(): | |
return "Calm down, I know what I'm doing!" | |
case remark.isShouting(): | |
return "Whoa, chill out!" | |
case remark.isQuestion(): | |
return "Sure." | |
default: | |
return "Whatever." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment