Set assigns value to named internal property. If the named property does not exist or cannot be set, the method does nothing.
(name string, val interface{})
| 104 | // Set assigns value to named internal property. If the named property does not |
| 105 | // exist or cannot be set, the method does nothing. |
| 106 | func (o *ReceiverObject) Set(name string, val interface{}) { |
| 107 | // Do not attempt to set non-existing or unset-able field. |
| 108 | if _, exists := o.values[name]; !exists || !o.values[name].CanSet() { |
| 109 | return |
| 110 | } |
| 111 | |
| 112 | o.values[name].Set(reflect.ValueOf(val)) |
| 113 | } |
| 114 | |
| 115 | // Exists checks if named internal property exists and returns true, or false if |
| 116 | // property does not exist. |
no outgoing calls
no test coverage detected