makeAddressable returns a value that is always addressable. It returns the input verbatim if it is already addressable, otherwise it creates a new value and returns an addressable copy.
(v reflect.Value)
| 662 | // It returns the input verbatim if it is already addressable, |
| 663 | // otherwise it creates a new value and returns an addressable copy. |
| 664 | func makeAddressable(v reflect.Value) reflect.Value { |
| 665 | if v.CanAddr() { |
| 666 | return v |
| 667 | } |
| 668 | vc := reflect.New(v.Type()).Elem() |
| 669 | vc.Set(v) |
| 670 | return vc |
| 671 | } |
no test coverage detected
searching dependent graphs…