Crafting a countdown in Golang

Report a typo

In the following Go code snippet,

var i int = 5
for ; i >= 0; i-- {
    fmt.Println(i)
}

What changes would you make to create a countdown from 10 to 1 and print "Liftoff!" when the countdown ends?

Select one option from the list

Create a free account to access the full topic