Get returns a named internal property of the receiver object instance, or an error if the property does not exist or is not addressable.
(name string)
| 89 | // Get returns a named internal property of the receiver object instance, or an |
| 90 | // error if the property does not exist or is not addressable. |
| 91 | func (o *ReceiverObject) Get(name string) (*Value, error) { |
| 92 | if _, exists := o.values[name]; !exists || !o.values[name].CanInterface() { |
| 93 | return nil, fmt.Errorf("Value '%s' does not exist or is not addressable", name) |
| 94 | } |
| 95 | |
| 96 | val, err := NewValue(o.values[name].Interface()) |
| 97 | if err != nil { |
| 98 | return nil, err |
| 99 | } |
| 100 | |
| 101 | return val, nil |
| 102 | } |
| 103 | |
| 104 | // Set assigns value to named internal property. If the named property does not |
| 105 | // exist or cannot be set, the method does nothing. |
no test coverage detected