code: func (p *TypeSetterPrinter) PrintObj(obj runtime.Object, w io.Writer) error {
  	if obj == nil {
  		return p.Delegate.PrintObj(obj, w)
  	}
  	if !obj.GetObjectKind().GroupVersionKind().Empty() {
  		return p.Delegate.PrintObj(obj, w)
  	}
  
  	// we were empty coming in, make sure we're empty going out.  This makes the call thread-unsafe
  	defer func() {
  		obj.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{})
  	}()
  
  	gvks, _, err := p.Typer.ObjectKinds(obj)
  	if err != nil {
  		// printers wrapped by us expect to find the type information present
  		return fmt.Errorf("missing apiVersion or kind and cannot assign it; %v", err)
  	}
  
  	for _, gvk := range gvks {
  		if len(gvk.Kind) == 0 {
  			continue
  		}
  		if len(gvk.Version) == 0 || gvk.Version == runtime.APIVersionInternal {
  			continue
  		}
  		obj.GetObjectKind().SetGroupVersionKind(gvk)
  		break
  	}
  
  	return p.Delegate.PrintObj(obj, w)
  }
docs: // PrintObj is an implementation of ResourcePrinter.PrintObj which sets type information on the obj for the duration
  // of printing.  It is NOT threadsafe.