1 Star 0 Fork 0

gxj / delve

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
testnextprog.go 576 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"fmt"
"runtime"
"time"
)
func sleepytime() {
time.Sleep(5 * time.Millisecond)
}
func helloworld() {
fmt.Println("Hello, World!")
}
func testnext() {
var (
j = 1
f = 2
)
for i := 0; i <= 5; i++ {
j += j * (j ^ 3) / 100
if i == f {
fmt.Println("foo")
break
}
sleepytime()
}
helloworld()
}
func main() {
d := make(chan int)
testnext()
go testgoroutine(9, d)
<-d
fmt.Println("done")
}
// fix line
func testgoroutine(foo int, d chan int) {
d <- foo
}
func init() {
runtime.LockOSThread()
runtime.GOMAXPROCS(4)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/guoxiaojun19991011/delve.git
git@gitee.com:guoxiaojun19991011/delve.git
guoxiaojun19991011
delve
delve
v1.0.0-rc.1

搜索帮助

344bd9b3 5694891 D2dac590 5694891