package main
import (
"fmt"
"time"
)
func main() {
ticker := time.NewTicker(1 * time.Second)
for {
select {
case <-ticker.C:
fmt.Println("test")
}
}
}
package main
import (
"fmt"
"time"
)
func main() {
ticker := time.NewTicker(1 * time.Second)
for range ticker.C {
fmt.Println("test")
}
}