Files
bililive-go/src/instance/context.go
T
2020-05-29 22:35:39 +08:00

19 lines
208 B
Go

package instance
import (
"context"
)
type key int
const (
Key key = 114514
)
func GetInstance(ctx context.Context) *Instance {
if s, ok := ctx.Value(Key).(*Instance); ok {
return s
}
return nil
}