Function
withStackValue
(parent *stackValues, key, value interface{})
Source from the content-addressed store, hash-verified
| 41 | } |
| 42 | |
| 43 | func withStackValue(parent *stackValues, key, value interface{}) *stackValues { |
| 44 | if key == nil { |
| 45 | panic("nil key") |
| 46 | } |
| 47 | if !reflect.TypeOf(key).Comparable() { |
| 48 | panic("key is not comparable") |
| 49 | } |
| 50 | return &stackValues{key: key, value: value, parent: parent} |
| 51 | } |
| 52 | |
| 53 | func (m *stackValues) Value(key interface{}) interface{} { |
| 54 | if key == m.key { |
Tested by
no test coverage detected