mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
14 lines
221 B
Go
14 lines
221 B
Go
package ctxkey
|
|
|
|
import "context"
|
|
|
|
type Key struct{}
|
|
|
|
func Set(ctx context.Context, data any) context.Context {
|
|
return context.WithValue(ctx, Key{}, data)
|
|
}
|
|
|
|
func Get(ctx context.Context) any {
|
|
return ctx.Value(Key{})
|
|
}
|