github.com/sagernet/sing-box@v1.2.7/common/debugio/print.go (about) 1 package debugio 2 3 import ( 4 "fmt" 5 "reflect" 6 7 "github.com/sagernet/sing/common" 8 ) 9 10 func PrintUpstream(obj any) { 11 for obj != nil { 12 fmt.Println(reflect.TypeOf(obj)) 13 if u, ok := obj.(common.WithUpstream); !ok { 14 break 15 } else { 16 obj = u.Upstream() 17 } 18 } 19 }