MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / WithContext

Function WithContext

version/context.go:7–9  ·  view source on GitHub ↗
(ctx context.Context, version *VersionInfo)

Source from the content-addressed store, hash-verified

5var ContextKey = struct{ string }{"version"}
6
7func WithContext(ctx context.Context, version *VersionInfo) context.Context {
8 return context.WithValue(ctx, ContextKey, version)
9}
10
11func FromContext(ctx context.Context) *VersionInfo {
12 if c, ok := ctx.Value(ContextKey).(*VersionInfo); ok {

Callers 1

ExecuteFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected