Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/util/validator/validator.go

20 lignes
408 B
Go
Brut Vue normale Historique

package validator
import (
"reflect"
"strconv"
2017-06-29 13:15:23 +02:00
"github.com/asaskevich/govalidator"
"github.com/NyaaPantsu/nyaa/util/log"
msg "github.com/NyaaPantsu/nyaa/util/messages"
)
2017-06-29 13:15:23 +02:00
/
// ValidateForm : Check if a form is valid according to its tags
2017-05-21 18:13:28 +02:00
func ValidateForm(form interface{}, mes *msg.Messages) {
2017-06-29 13:20:52 +02:00
result, err := govalidator.ValidateStruct(form)
2017-06-29 13:15:23 +02:00
if err != nil {
println("error: " + err.Error())
}
}