Golang 实现 3 秒结束的死循环代码示例
package main
import ( "fmt" "time" )
func main() { go func() { for { fmt.Println('Hello, World!') time.Sleep(500 * time.Millisecond) } }() time.Sleep(3 * time.Second) }
原文地址: https://www.cveoy.top/t/topic/lrOs 著作权归作者所有。请勿转载和采集!