@ -286,7 +286,7 @@ func Longitude[T any](t T) bool {
// JSON is the validation function for validating if the current field's value is a valid json string.
func JSON[T any](t T) bool {
rv := reflect.ValueOf(t)
if rv.Type() == bytesType {
if rv.Type() == nilType {
return json.Valid(rv.Bytes())
}
if rv.Kind() == reflect.String {
@ -16,7 +16,7 @@ var (
ErrBadRange = errors.New("bad value range")
timeType = reflect.TypeOf(time.Time{})
//nilType = reflect.TypeOf([]byte(nil))
nilType = reflect.TypeOf([]byte(nil))
)
// convert value to float64, return error on failed