github.com/nikandfor/tlog@v0.21.5-0.20231108111739-3ef89426a96d/tlio/unwrap.go (about) 1 package tlio 2 3 type ( 4 Unwrapper interface { 5 Unwrap() interface{} 6 } 7 ) 8 9 func Unwrap(x interface{}) interface{} { 10 w, ok := x.(Unwrapper) 11 if !ok { 12 return nil 13 } 14 15 return w.Unwrap() 16 }