Esempio n. 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()
}
Esempio n. 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()
}