1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-19 17:29:54 -04:00
Files
v2fly/common/environment/envctx/env.go
2022-04-29 21:36:26 +01:00

16 lines
358 B
Go

package envctx
import "context"
const (
environmentKey string = "v2.environment"
)
func ContextWithEnvironment(ctx context.Context, environment interface{}) context.Context {
return context.WithValue(ctx, environmentKey, environment) //nolint: revive
}
func EnvironmentFromContext(ctx context.Context) interface{} {
return ctx.Value(environmentKey)
}