WithIndent
Adds an additional indentation string to the current indentation level stored in the context and returns a new context with the updated indentation.
def WithIndent(
ctx: context.Context,
additionalIndent: string
) - > context.Context
Adds an additional indentation level to the provided context. This function is used to manage and propagate indentation settings across different parts of an application, typically for logging or structured output.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context to which the additional indentation will be applied. This context may already contain an existing indentation level. |
| additionalIndent | string | The string representing the additional indentation to be added to the current indent level. This could be spaces, tabs, or any other string used for indentation. |
Returns
| Type | Description |
|---|---|
context.Context | A new context derived from the input context, with the updated indentation level. |