1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00
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)
}