Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

26 lines
302 B

package main
import (
"fmt"
"strconv"
)
func main() {
var line string
for i := 1; i <= 100; i++ {
if i%3 == 0 {
line += "Fizz"
}
if i%5 == 0 {
line += "Buzz"
}
if len(line) == 0 {
line = strconv.Itoa(i)
}
fmt.Println(line)
line = ""
}
}