常用类型及数据操作方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

48 lines
781 B

package helper
import (
"testing"
)
func Test_ToInt64(t *testing.T) {
var str interface{} = 45.00
ret := ToInt64(str)
t.Log(ret)
}
func Test_GetRandomNumber(t *testing.T) {
rand := GetRandomNumber(8)
fmt.Println(rand)
}
func Test_GetRandomString(t *testing.T) {
rand := GetRandomString(25)
fmt.Println(rand)
}
func Test_DeleteExtraSpace(t *testing.T) {
s := "c s dfdf dff df x"
s2 := DeleteExtraSpace(s)
t.Log(s2)
}
func Test_StringJoin(t *testing.T) {
s1 := "testing"
s2 := "测试一"
s3 := "二"
s4 := " ,s e"
fmt.Println(StringJoin(s1, s2, s3, s4))
}
func Test_ToString(t *testing.T) {
var str float64 = 0.15
t.Log(str)
ret := ToString(str)
t.Log(ret)
}
func Test_ToInt(t *testing.T) {
var str interface{} = 45
ret := ToInt(str)
t.Log(ret)
}