code: func (c *Catalog) Deregister(args *structs.DeregisterRequest, reply *struct{}) error {
  	if done, err := c.srv.forward("Catalog.Deregister", args, args, reply); done {
  		return err
  	}
  	defer metrics.MeasureSince([]string{"catalog", "deregister"}, time.Now())
  
  	// Verify the args
  	if args.Node == "" {
  		return fmt.Errorf("Must provide node")
  	}
  
  	// Fetch the ACL token, if any.
  	rule, err := c.srv.ResolveToken(args.Token)
  	if err != nil {
  		return err
  	}
  
  	// Check the complete deregister request against the given ACL policy.
  	if rule != nil && c.srv.config.ACLEnforceVersion8 {
  		state := c.srv.fsm.State()
  
  		var ns *structs.NodeService
  		if args.ServiceID != "" {
  			_, ns, err = state.NodeService(args.Node, args.ServiceID)
  			if err != nil {
  				return fmt.Errorf("Service lookup failed: %v", err)
  			}
  		}
  
  		var nc *structs.HealthCheck
  		if args.CheckID != "" {
  			_, nc, err = state.NodeCheck(args.Node, args.CheckID)
  			if err != nil {
  				return fmt.Errorf("Check lookup failed: %v", err)
  			}
  		}
  
  		if err := vetDeregisterWithACL(rule, args, ns, nc); err != nil {
  			return err
  		}
  
  	}
  
  	if _, err := c.srv.raftApply(structs.DeregisterRequestType, args); err != nil {
  		return err
  	}
  	return nil
  }
docs: // Deregister is used to remove a service registration for a given node.