GetVariable
Retrieves a variable from a VariableMap by key. Returns nil if the key is not found or if the VariableMap is nil.
def GetVariable(
vm: *core.VariableMap,
key: string
) - > *core.Variable
Retrieves a variable from a VariableMap by its key. This function is used to access specific configuration or runtime variables stored within a VariableMap structure.
Parameters
| Name | Type | Description |
|---|---|---|
| vm | *core.VariableMap | The VariableMap from which to retrieve the variable. If nil, the function will return nil. |
| key | string | The string key used to identify and retrieve the desired variable from the VariableMap. |
Returns
| Type | Description |
|---|---|
*core.Variable | The core.Variable associated with the key, or nil if the key is not found or if the provided VariableMap is nil. |