parent
564d214dd1
commit
127dc0d250
@ -0,0 +1,4 @@
|
|||||||
|
package convert
|
||||||
|
|
||||||
|
type Conv struct {
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
package convert
|
||||||
|
|
||||||
|
var conv Conv
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package convert
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestConv_IntToStr(t *testing.T) {
|
||||||
|
fmt.Println(conv.IntToStr(3455675656) + "okok")
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package convert
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestConv_StrToInt(t *testing.T) {
|
||||||
|
fmt.Println(conv.StrToInt("345"))
|
||||||
|
fmt.Println(conv.StrToInt("3r45"))
|
||||||
|
fmt.Println(conv.StrToInt("3r45", 45))
|
||||||
|
|
||||||
|
}
|
||||||
|
func TestConv_StrToInt64(t *testing.T) {
|
||||||
|
fmt.Println(conv.StrToInt64("34567"))
|
||||||
|
fmt.Println(conv.StrToInt64("34ttt567"))
|
||||||
|
fmt.Println(conv.StrToInt64("34ttt567", 789))
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in new issue