Ai
1 Star 0 Fork 3.4K

andyLin/LearningNotes

forked from 陌溪/LearningNotes 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 410 Bytes
一键复制 编辑 原始数据 按行查看 历史
陌溪 提交于 2020-09-17 18:38 +08:00 . docs:增加Gin框架学习笔记和代码
package main
import (
"fmt"
"time"
)
func hello(i int) {
fmt.Println("hello ", i)
}
// 程序启动之后,会创建一个主goroutine去执行
func main() {
// 开启一个单独的goroutine去执行hello函数(函数)
for i := 0; i < 10; i++ {
go func(i int) {
// 闭包问题,需要在外面传递一个进去
fmt.Println(i)
}(i)
}
fmt.Println("main")
time.Sleep(time.Second)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/andy1234/LearningNotes.git
git@gitee.com:andy1234/LearningNotes.git
andy1234
LearningNotes
LearningNotes
master

搜索帮助