MCPcopy Index your code
hub / github.com/coder/envbox / WithEnvironFn

Function WithEnvironFn

xunix/env.go:13–15  ·  view source on GitHub ↗
(ctx context.Context, fn EnvironFn)

Source from the content-addressed store, hash-verified

11type EnvironFn func() []string
12
13func WithEnvironFn(ctx context.Context, fn EnvironFn) context.Context {
14 return context.WithValue(ctx, environKey{}, fn)
15}
16
17func Environ(ctx context.Context) []string {
18 fn := ctx.Value(environKey{})

Callers 2

TestDockerFunction · 0.92
TestGPUEnvsFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestDockerFunction · 0.74
TestGPUEnvsFunction · 0.74