This commit is contained in:
wangchuxiao
2023-03-14 15:35:58 +08:00
parent d0211ebd89
commit 6afb47ba06
6 changed files with 26 additions and 31 deletions
+10
View File
@@ -54,6 +54,16 @@ func GetOpUserID(ctx context.Context) string {
return ""
}
func GetConnID(ctx context.Context) string {
if ctx.Value(constant.ConnID) != "" {
s, ok := ctx.Value(constant.ConnID).(string)
if ok {
return s
}
}
return ""
}
func Unwrap(err error) error {
for err != nil {
unwrap, ok := err.(interface {