Skip to content

Instantly share code, notes, and snippets.

@klrkdekira
Created August 20, 2016 14:02
Show Gist options
  • Save klrkdekira/4e0b1d581488c2c22ca4631e28a11115 to your computer and use it in GitHub Desktop.
Save klrkdekira/4e0b1d581488c2c22ca4631e28a11115 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func main() {
for i := 1; i <= 100; i++ {
msg := fmt.Sprintf("%03d - ", i)
if i%3 == 0 {
msg += "fizz"
}
if i%5 == 0 {
msg += "buzz"
}
fmt.Println(msg)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment