摘要: https://www.jianshu.com/p/40c4ba729eac package mainimport ( "context" "fmt" "time")func emain() { d := time.Now().Add(1 * time.Second) ctx, cancel := 阅读全文
posted @ 2020-06-11 13:52 zJanly 阅读(172) 评论(0) 推荐(0)
摘要: https://www.jianshu.com/p/e5df3cd0708b Context背景 和 适用场景 golang在1.6.2的时候还没有自己的context,在1.7的版本中就把golang.org/x/net/context包被加入到了官方的库中。golang 的 Context包,是 阅读全文
posted @ 2020-06-11 11:23 zJanly 阅读(273) 评论(0) 推荐(0)