UnWrapObject unwraps o as much as possible and returns the base object
(o Object)
| 840 | |
| 841 | // UnWrapObject unwraps o as much as possible and returns the base object |
| 842 | func UnWrapObject(o Object) Object { |
| 843 | for { |
| 844 | u, ok := o.(ObjectUnWrapper) |
| 845 | if !ok { |
| 846 | break // not a wrapped object, use current |
| 847 | } |
| 848 | next := u.UnWrap() |
| 849 | if next == nil { |
| 850 | break // no base object found, use current |
| 851 | } |
| 852 | o = next |
| 853 | } |
| 854 | return o |
| 855 | } |
| 856 | |
| 857 | // UnWrapObjectInfo returns the underlying Object unwrapped as much as |
| 858 | // possible or nil. |
no test coverage detected
searching dependent graphs…