code: func (opts *SUBSCRIBEOptions) validate() error {
  	// Check the Packet Identifier.
  	if opts.PacketID == 0 {
  		return ErrInvalidPacketID
  	}
  
  	// Check the existence of the subscription requests.
  	if len(opts.SubReqs) == 0 {
  		return ErrInvalidNoSubReq
  	}
  
  	// Validate each subscription request.
  	for _, s := range opts.SubReqs {
  		if err := s.validate(); err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // validate validates the options.