GetVar gets a value out of the context's variable table by key. If the key does not exist, the return value will be nil.
(ctx context.Context, key string)
| 431 | // GetVar gets a value out of the context's variable table by key. |
| 432 | // If the key does not exist, the return value will be nil. |
| 433 | func GetVar(ctx context.Context, key string) any { |
| 434 | varMap, ok := ctx.Value(VarsCtxKey).(map[string]any) |
| 435 | if !ok { |
| 436 | return nil |
| 437 | } |
| 438 | return varMap[key] |
| 439 | } |
| 440 | |
| 441 | // SetVar sets a value in the context's variable table with |
| 442 | // the given key. It overwrites any previous value with the |
no test coverage detected