Closed tpphu closed 5 years ago
Da anh @tpphu , em co custom lai error theo ngon ngu en
func translateIndividual(trans ut.Translator) string {
type Note struct {
Title string `validate:"min=6,max=100"`
}
var note Note
err := validate.Struct(note)
if err != nil {
errs := err.(validator.ValidationErrors)
for _, e := range errs {
return e.Translate(trans)
}
}
return ""
}
Các bạn hãy tiếp tục làm bài tập số 3 với suy nghĩ xem làm thế nào để báo lỗi thân thiện hơn và theo ngôn ngữ:
en
,vi