gitee.com/quant1x/num@v0.3.2/type_test.go (about) 1 package num 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func Test_typeDefault(t *testing.T) { 9 fmt.Println(TypeDefault[float32]()) 10 fmt.Println(TypeDefault[float64]()) 11 12 fmt.Println(TypeDefault[bool]()) 13 fmt.Println(TypeDefault[string]()) 14 fmt.Println(TypeDefault[uintptr]()) 15 fmt.Println(TypeDefault[int8]()) 16 fmt.Println(TypeDefault[uint8]()) 17 fmt.Println(TypeDefault[int16]()) 18 fmt.Println(TypeDefault[uint16]()) 19 fmt.Println(TypeDefault[int32]()) 20 fmt.Println(TypeDefault[uint32]()) 21 fmt.Println(TypeDefault[int64]()) 22 fmt.Println(TypeDefault[uint64]()) 23 fmt.Println(TypeDefault[int]()) 24 fmt.Println(TypeDefault[uint]()) 25 } 26 27 func Test_Number(t *testing.T) { 28 29 } 30 31 func Test_anyToGeneric(t *testing.T) { 32 fmt.Println(AnyToGeneric[int](true)) 33 fmt.Println(AnyToGeneric[int]("true")) 34 fmt.Println(AnyToGeneric[int]("false")) 35 fmt.Println(AnyToGeneric[int]("aa")) 36 fmt.Println(AnyToGeneric[int]("tt")) 37 fmt.Println(AnyToGeneric[int](3.00)) 38 }