code: func (d *Decoder) Decode() (watch.EventType, runtime.Object, error) {
  	var got WatchEvent
  	if err := d.decoder.Decode(&got); err != nil {
  		return "", nil, err
  	}
  	switch got.Type {
  	case watch.Added, watch.Modified, watch.Deleted, watch.Error:
  	default:
  		return "", nil, fmt.Errorf("got invalid watch event type: %v", got.Type)
  	}
  
  	obj, err := d.codec.Decode(got.Object.RawJSON)
  	if err != nil {
  		return "", nil, fmt.Errorf("unable to decode watch event: %v", err)
  	}
  	return got.Type, obj, nil
  }
docs: // Decode blocks until it can return the next object in the writer. Returns an error
  // if the writer is closed or an object can't be decoded.