From 3946862fcde998154cf00b2f716f363443cc20a3 Mon Sep 17 00:00:00 2001 From: Reza Khademi Date: Sat, 2 Mar 2024 10:20:38 +0330 Subject: [PATCH] improved: minmax method docs --- max.go | 1 + min.go | 1 + validator.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/max.go b/max.go index 1b7c65d..fdbe585 100644 --- a/max.go +++ b/max.go @@ -1,5 +1,6 @@ package validator +// MaxInt checks i to be less than max value func (v *Validator) MaxInt(i, max int, field, msg string) *Validator { v.Check(i <= max, field, msg) diff --git a/min.go b/min.go index 4e8bb17..94d7287 100644 --- a/min.go +++ b/min.go @@ -1,5 +1,6 @@ package validator +// MinInt checks i to be greater than min value func (v *Validator) MinInt(i, min int, field, msg string) *Validator { v.Check(i >= min, field, msg) diff --git a/validator.go b/validator.go index 7a39b49..012b0a0 100644 --- a/validator.go +++ b/validator.go @@ -66,7 +66,7 @@ func (v *Validator) addError(field, msg string) { } } -// ErrMsg return error message and check if custom error message is set return formatted custom message +// msg return error message and check if custom error message is set return formatted custom message // otherwise return rule default message func (v *Validator) msg(method, field string, msg string) string { if msg != "" {