wangshan 3 жил өмнө
parent
commit
2cf74bc7e3
1 өөрчлөгдсөн 13 нэмэгдсэн , 0 устгасан
  1. 13 0
      common/common.go

+ 13 - 0
common/common.go

@@ -28,6 +28,19 @@ const (
 	tmp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678900"
 )
 
+var (
+	// int 强制转换
+	Int   = InterfaceToInt
+	Int64 = InterfaceToInt64
+	Int32 = InterfaceToInt32
+	// float 强制转换
+	Float64 = InterfaceToFloat64
+	// string 强制转换
+	Str = InterfaceToStr
+	// bool 强制转换
+	Bool = InterfaceToBool
+)
+
 func Uuid(length int) string {
 	ret := []string{}
 	r := mathRand.New(mathRand.NewSource(time.Now().UnixNano()))