mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-27 09:00:25 +08:00
53
strUtil/str_to_uint_x_example_test.go
Normal file
53
strUtil/str_to_uint_x_example_test.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package strUtil
|
||||
|
||||
import "fmt"
|
||||
|
||||
func ExampleStrToUint() {
|
||||
s := "200"
|
||||
res := StrToUint(s)
|
||||
|
||||
fmt.Printf("%d,%T\n", res, res)
|
||||
|
||||
// Output:
|
||||
// 200,uint
|
||||
}
|
||||
|
||||
func ExampleStrToUint8() {
|
||||
s := "200"
|
||||
res := StrToUint8(s)
|
||||
|
||||
fmt.Printf("%d,%T\n", res, res)
|
||||
|
||||
// Output:
|
||||
// 200,uint8
|
||||
}
|
||||
|
||||
func ExampleStrToUint16() {
|
||||
s := "200"
|
||||
res := StrToUint16(s)
|
||||
|
||||
fmt.Printf("%d,%T\n", res, res)
|
||||
|
||||
// Output:
|
||||
// 200,uint16
|
||||
}
|
||||
|
||||
func ExampleStrToUint32() {
|
||||
s := "200"
|
||||
res := StrToUint32(s)
|
||||
|
||||
fmt.Printf("%d,%T\n", res, res)
|
||||
|
||||
// Output:
|
||||
// 200,uint32
|
||||
}
|
||||
|
||||
func ExampleStrToUint64() {
|
||||
s := "200"
|
||||
res := StrToUint64(s)
|
||||
|
||||
fmt.Printf("%d,%T\n", res, res)
|
||||
|
||||
// Output:
|
||||
// 200,uint64
|
||||
}
|
||||
Reference in New Issue
Block a user