소스 검색

fix: support multiple basic types

Yeuoly 8 달 전
부모
커밋
894c47b00f
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      internal/types/entities/plugin_entities/basic_type.go

+ 4 - 1
internal/types/entities/plugin_entities/basic_type.go

@@ -25,7 +25,10 @@ func NewI18nObject(def string) I18nObject {
 func isBasicType(fl validator.FieldLevel) bool {
 	// allowed int, string, bool, float64
 	switch fl.Field().Kind() {
-	case reflect.Int, reflect.String, reflect.Bool, reflect.Float64:
+	case reflect.Int, reflect.String, reflect.Bool,
+		reflect.Float64, reflect.Float32,
+		reflect.Uint, reflect.Uint64, reflect.Uint32, reflect.Uint16, reflect.Uint8,
+		reflect.Int64, reflect.Int32, reflect.Int16, reflect.Int8:
 		return true
 	case reflect.Ptr:
 		// check if the pointer is nil