MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ContentWithValues

Function ContentWithValues

server/common/common.go:148–157  ·  view source on GitHub ↗
(ctx context.Context, keyAndValue ...any)

Source from the content-addressed store, hash-verified

146}
147
148func ContentWithValues(ctx context.Context, keyAndValue ...any) context.Context {
149 if len(keyAndValue) < 1 || len(keyAndValue)%2 != 0 {
150 panic("keyAndValue must be an even number of arguments (key, value, ...)")
151 }
152 for len(keyAndValue) > 0 {
153 ctx = context.WithValue(ctx, keyAndValue[0], keyAndValue[1])
154 keyAndValue = keyAndValue[2:]
155 }
156 return ctx
157}

Callers 1

GinAppendValuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected