MCPcopy Create free account
hub / github.com/belak/gitdir / CtxConfig

Function CtxConfig

context.go:40–47  ·  view source on GitHub ↗

CtxConfig pulls the current Config out of the context, or a blank Config if not set.

(ctx context.Context)

Source from the content-addressed store, hash-verified

38// CtxConfig pulls the current Config out of the context, or a blank Config if
39// not set.
40func CtxConfig(ctx context.Context) *Config {
41 if c, ok := ctx.Value(contextKeyConfig).(*Config); ok {
42 return c
43 }
44
45 // If it doesn't exist, return a new empty config for safety.
46 return NewConfig(memfs.New())
47}
48
49// CtxSetUser puts the given User into the ssh.Context.
50func CtxSetUser(parent ssh.Context, user *User) {

Callers 2

TestCtxConfigFunction · 0.85
CtxExtractFunction · 0.85

Calls 1

NewConfigFunction · 0.85

Tested by 1

TestCtxConfigFunction · 0.68