2 Star 1 Fork 1

mosache / YFrame

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
context.go 300 Bytes
一键复制 编辑 原始数据 按行查看 历史
ヤ沒脩袮兲︶ 提交于 2023-08-24 16:15 . temp
package rpc
import "context"
type oneWayKey struct {
}
func ContextWithOneway(ctx context.Context) context.Context {
return context.WithValue(ctx, oneWayKey{}, true)
}
func IsOneWayContext(ctx context.Context) bool {
val := ctx.Value(oneWayKey{})
onWay, ok := val.(bool)
return ok && onWay
}
Go
1
https://gitee.com/mosache/YFrame.git
git@gitee.com:mosache/YFrame.git
mosache
YFrame
YFrame
v0.1.75

搜索帮助

53164aa7 5694891 3bd8fe86 5694891