1.10.2
Test / testing (1.19.13, ubuntu-latest) (push) Failing after 1m32s Details
Test / testing (>=1.20, ubuntu-latest) (push) Has been cancelled Details

This commit is contained in:
Akvicor 2024-02-19 16:46:54 +08:00
parent 4dec9bfb86
commit b2e2332d98
3 changed files with 32 additions and 0 deletions

View File

@ -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)
}

View File

@ -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)
}

View File

@ -28,3 +28,11 @@ func ExampleTcpPortIsOpenByAddr() {
// true
// false
}
func ExampleGetAvailablePort() {
p, err := GetAvailablePort()
if err != nil {
fmt.Println(err)
}
fmt.Println(p)
}