We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://www.cyhone.com/articles/context-to-panic/
我们有这么一段业务代码,在 Gin 的 API Handler 中,开了一个子 goroutine 写 DB,代码大概是这样: package main import ( "github.com/gin-gonic/gin" "gorm.io/gorm" ) var db *gorm.DB func Ech
The text was updated successfully, but these errors were encountered:
很有趣的文章,感谢分享。
关注到一些小的细节:
子 goroutine 中可以用context.Background()创建一个新的 context 对象 ,和外部接口主逻辑的 context 分离开
我们之后应该如何避免: 方法三
ContextWithFallback
sync.Pool
gin.Context.Copy
gin.Context
context.Context
go myFunc(ctx, a, b, c)
Sorry, something went wrong.
No branches or pull requests
https://www.cyhone.com/articles/context-to-panic/
我们有这么一段业务代码,在 Gin 的 API Handler 中,开了一个子 goroutine 写 DB,代码大概是这样: package main import ( "github.com/gin-gonic/gin" "gorm.io/gorm" ) var db *gorm.DB func Ech
The text was updated successfully, but these errors were encountered: