1.10.2
This commit is contained in:
parent
4dec9bfb86
commit
b2e2332d98
15
file_test.go
15
file_test.go
|
@ -54,3 +54,18 @@ func TestDirList(t *testing.T) {
|
|||
// fmt.Printf("%s %s %s %s\n", v.Mode, v.ModTime.Format(time.DateTime), Size(v.Size).HighestUnit(true).Format(7, "", false), v.Name)
|
||||
// }
|
||||
}
|
||||
|
||||
func ExampleMkdirP() {
|
||||
err := MkdirP("testfile/testfile")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleDirSize() {
|
||||
p, err := DirSize("./testfile")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(p)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
@ -186,3 +187,11 @@ func TestUint32ToIP(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleGetLocalIp() {
|
||||
p, err := GetLocalIp()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(p)
|
||||
}
|
||||
|
|
|
@ -28,3 +28,11 @@ func ExampleTcpPortIsOpenByAddr() {
|
|||
// true
|
||||
// false
|
||||
}
|
||||
|
||||
func ExampleGetAvailablePort() {
|
||||
p, err := GetAvailablePort()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(p)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue