// AssertRequired asserts that the required arguments of the request
// are meeted, if they arent, an error describing the missings required
// arguments is returned.
AssertRequired asserts that the required arguments of the request
are meeted, if they arent, an error describing the missings required
arguments is returned.
// AssertRequired asserts that the required arguments of the request // are meeted if they arent an error describing the missings required // arguments is returned .
func (req *Request) AssertRequired() error {
	needOptions := make([]string, 0, len(req.required))
	for _, key := range req.required {
		if _, ok := req.arguments[key]; !ok {
			needOptions = append(needOptions, key)
		}
	}
	if len(needOptions) > 0 {
		return errors.New(strings.Join(needOptions, ", "))
	}
	return nil
}
func ( req * Request ) AssertRequired ( ) error { needOptions := make ( [ ] string , 0 , len ( req . required ) ) for _ , key := range req . required { if _ , ok := req . arguments [ key ] ; ! ok { needOptions = append ( needOptions , key ) } } if len ( needOptions ) > 0 { return errors . New ( strings . Join ( needOptions , " " ) ) } return nil }
AssertRequired asserts that the required arguments of the request
are meeted, if they arent, an error describing the missings required
arguments is returned.
AssertRequired asserts that the required arguments of the request are meeted if they arent an error describing the missings required arguments is returned .