From 548c0860799c666aed69a47735bd24895716eef8 Mon Sep 17 00:00:00 2001 From: nochill Date: Sun, 17 Sep 2023 16:31:40 +0700 Subject: [PATCH] add max error validation --- api/BaseResponse.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/BaseResponse.go b/api/BaseResponse.go index a623726..678c2b4 100644 --- a/api/BaseResponse.go +++ b/api/BaseResponse.go @@ -16,7 +16,9 @@ type APIValidationError struct { func validationErrorMsg(field string, param string, tag string) string { switch tag { case "min": - return fmt.Sprintf("%s character min %s", field, param) + return fmt.Sprintf("%s character min %s character", field, param) + case "max": + return fmt.Sprintf("%s character max %s character", field, param) case "required": return fmt.Sprintf("%s is %s", field, tag) default: