Skip to main content

WithPhase

Gets a new context with Phase set.

def WithPhase(
ctx: context.Context,
phase: string
) - > context.Context

Gets a new context with Phase set. This function is used to associate a specific phase string with a context, allowing subsequent operations to retrieve and utilize this phase information.

Parameters​

NameTypeDescription
ctxcontext.ContextThe existing context to which the phase will be added.
phasestringThe string value representing the phase to be associated with the context.

Returns​

TypeDescription
context.ContextA new context.Context object that includes the specified phase.