I have a function here that loops through and print numbers. I do not have anything to return. How can I avoid this without having to return a value?
func Problem1V3() Nil {
sum := 0
for i := 3; i < 1000; i+=3 {
fmt.Printf("i loop: %v", i)
}
return Nil
}
I think this should work.
func Problem1V3() {
for i := 3; i < 1000; i+=3 {
fmt.Printf("i loop: %v", i)
}
}
You can run it at http://play.golang.org/p/irUI1sCx_B
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With