print.go 264 B

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