Intern — Middle
Sequential output of numbers with a one-second pause
livecode
Task condition
It is necessary to write a program that outputs numbers from 1 to 10 in increasing order at one-second intervals.
package main
import (
"fmt"
"time"
)
func main() {
// TODO: call the print function for numbers from 1 to 10
}
func printNumber(n int) {
time.Sleep(time.Second)
fmt.Println(n)
}