Context WithValue best practices

Always capture the return value of context.WithValue to use the new context and avoid memory leaks.

Always use the return values from context.WithValue to ensure the new context is used and to prevent memory leaks from holding onto the parent context. The unusedresult analyzer explicitly flags calls to context.WithValue where the result is ignored because the function returns a new context that must be propagated down the call stack.

ctx := context.WithValue(parentCtx, key, value)
// Use ctx for subsequent operations, not parentCtx
myFunc(ctx)