Пример #1
0
func (s Shortcuts) DecodeAndValidate(req *http.Request, form forms.Form) error {
	err := forms.DecodeForm(form, req)

	if err != nil {
		return err
	}

	return form.Validate()
}
Пример #2
0
func (s TemplatingShortcuts) ProcessForm(req *http.Request, form forms.Form) error {
	if err := forms.DecodeForm(form, req); err != nil {
		return err
	}

	if err := form.Validate(); err != nil {
		return err
	}

	return form.Save()
}