随笔分类 -  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 阅读(55) 评论(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 阅读(63) 评论(0) 推荐(0)

导航