随笔分类 -  go 并发编程

一个简单demo展示应用接口使用goroutine优雅退出
摘要:package main import ( "context" "errors" "log" "net/http" "sync" "time" ) type Tracker struct { wg sync.WaitGroup } type App struct { track Tracker } 阅读全文

posted @ 2022-03-08 15:48 biwentao 阅读(42) 评论(0) 推荐(0) 编辑

一个简单demo展示接口请求超时处理
摘要:package main import ( "context" "errors" "fmt" "time" ) type result struct { record string err error } func search(term string) (string, error) { time 阅读全文

posted @ 2022-03-08 15:19 biwentao 阅读(53) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示