修改core仓库名称
This commit is contained in:
1 parent
33b462217c
commit
8817f02038
15 files changed
+571
-11
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package logger
|
||||
|
||||
import "context"
|
||||
|
||||
type loggerKey struct{}
|
||||
|
||||
func FromContext(ctx context.Context) (Logger, bool) {
|
||||
l, ok := ctx.Value(loggerKey{}).(Logger)
|
||||
return l, ok
|
||||
}
|
||||
|
||||
func NewContext(ctx context.Context, l Logger) context.Context {
|
||||
return context.WithValue(ctx, loggerKey{}, l)
|
||||
}
|
||||
Reference in new issue
Block a user