code: func DetachTags(c context.Context, inst *Instance, tags []*api.Tag) error {
  	return Txn(c, "DetachTags", func(c context.Context) error {
  		existing, _, err := checkExistingTags(c, inst, tags)
  		if err != nil {
  			return err
  		}
  
  		if err := datastore.Delete(c, existing); err != nil {
  			return transient.Tag.Apply(err)
  		}
  
  		events := Events{}
  		for _, t := range existing {
  			events.Emit(&api.Event{
  				Kind:     api.EventKind_INSTANCE_TAG_DETACHED,
  				Package:  inst.Package.StringID(),
  				Instance: inst.InstanceID,
  				Tag:      t.Tag,
  			})
  		}
  		return events.Flush(c)
  	})
  }
docs: // DetachTags detaches a bunch of tags from an instance.
  //
  // Assumes inputs are already validated. Launches a transaction inside (and thus
  // can't be a part of a transaction itself).
  //
  // 'inst' is used only for its key.