Skip to content

Instantly share code, notes, and snippets.

@genghisjahn
Created September 26, 2013 01:29
Show Gist options
  • Save genghisjahn/6708640 to your computer and use it in GitHub Desktop.
Save genghisjahn/6708640 to your computer and use it in GitHub Desktop.
FizzBuzzDivisor for BlogPost
package fizzbuzz
import(
"strconv"
)
type FizzBuzzDivisor struct{
Value int //Value to be tested.
Message string //Message if a condition is met.
}
func (fbd FizzBuzzDivisor) GetResult(num int) string {
result:=strconv.Itoa(num)
if num % fbd.Value==0{
result = fbd.Message
}
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment