code: func DeleteRef(c context.Context, pkg, ref string) error {
  	return Txn(c, "DeleteRef", func(c context.Context) error {
  		r, err := GetRef(c, pkg, ref)
  		switch {
  		case grpcutil.Code(err) == codes.NotFound:
  			return nil
  		case err != nil:
  			return err // transient
  		}
  
  		err = datastore.Delete(c, &Ref{
  			Name:    ref,
  			Package: PackageKey(c, pkg),
  		})
  		if err != nil {
  			return transient.Tag.Apply(err)
  		}
  
  		return EmitEvent(c, &api.Event{
  			Kind:     api.EventKind_INSTANCE_REF_UNSET,
  			Package:  pkg,
  			Instance: r.InstanceID,
  			Ref:      ref,
  		})
  	})
  }
docs: // DeleteRef removes the ref if it exists.
  //
  // Does nothing if there's no such ref or package.