diff --git a/validators/validators.go b/validators/validators.go index 4e16a0d..e3d845d 100644 --- a/validators/validators.go +++ b/validators/validators.go @@ -288,7 +288,7 @@ func checkLength(args string, value interface{}) error { } count := float64(utf8.RuneCountInString(str)) if count < min || count > max { - return fmt.Errorf("expected a value between %s and %s, but got %s", f64(min), f64(max), f64(count)) + return fmt.Errorf("expected string length to be between %s and %s, but got %s", f64(min), f64(max), f64(count)) } return nil } diff --git a/validators/validators_test.go b/validators/validators_test.go index c4e2a54..b47c979 100644 --- a/validators/validators_test.go +++ b/validators/validators_test.go @@ -1,7 +1,6 @@ package validators import ( - "fmt" "math" "sync" "testing" @@ -822,14 +821,14 @@ func Test_f64(t *testing.T) { args: args{ f: math.MaxFloat64, }, - want: fmt.Sprint(math.MaxFloat64), + want: "max float64", }, { name: "min float", args: args{ f: -math.MaxFloat64, }, - want: fmt.Sprint(-math.MaxFloat64), + want: "min float64", }, } for _, tt := range tests {