GetStackValues returns the value pointed to by the key within the stack values, if it is present.
(ctx context.Context, key interface{})
| 24 | // GetStackValues returns the value pointed to by the key within the stack |
| 25 | // values, if it is present. |
| 26 | func GetStackValue(ctx context.Context, key interface{}) interface{} { |
| 27 | md, _ := ctx.Value(stackValuesKey{}).(*stackValues) |
| 28 | if md == nil { |
| 29 | return nil |
| 30 | } |
| 31 | |
| 32 | return md.Value(key) |
| 33 | } |
| 34 | |
| 35 | type stackValuesKey struct{} |
| 36 |