parent
51133d42ab
commit
155a58819c
@ -1,8 +0,0 @@
|
|||||||
package goarray
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestName(t *testing.T) {
|
|
||||||
ss := []string{"c2:37:7d:2b:78:c3", "c2:37:7d:2b:78:c4", "14:98:77:5a:58:66", "c2:37:7d:2b:78:a3", "c2:37:7d:2b:78:a4", "36:ce:4f:d2:84:00", "36:ce:4f:d2:84:04", "36:98:77:50:03:1b", "14:98:77:50:03:1b", "36:ce:4f:d2:84:00", "e2:ed:05:15:9c:2a", "e2:ed:05:15:9c:2a"}
|
|
||||||
t.Log(TurnString(ss))
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
package gobase64
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestEncode(t *testing.T) {
|
|
||||||
t.Log(Encode("广东茂名"))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDecode(t *testing.T) {
|
|
||||||
t.Log(Decode(Encode("广东茂名")))
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package godecimal
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestName(t *testing.T) {
|
|
||||||
t.Log(Decimal(2.3333))
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
package gohttp
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestName(t *testing.T) {
|
|
||||||
get, err := Get("https://api.dtapp.net/", nil)
|
|
||||||
t.Logf("%+v\n", get)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
package goint
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestToString(t *testing.T) {
|
|
||||||
t.Log(ToString(9898))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestToFloat64(t *testing.T) {
|
|
||||||
t.Log(ToFloat64(9898))
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
package goint64
|
|
@ -1,33 +0,0 @@
|
|||||||
package golog
|
|
||||||
|
|
||||||
import (
|
|
||||||
"log"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
var app = App{
|
|
||||||
LogPath: "./",
|
|
||||||
LogName: "all.log",
|
|
||||||
LogLevel: "debug",
|
|
||||||
MaxSize: 2,
|
|
||||||
MaxBackups: 30,
|
|
||||||
MaxAge: 0,
|
|
||||||
Compress: false,
|
|
||||||
JsonFormat: false,
|
|
||||||
ShowLine: true,
|
|
||||||
LogInConsole: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestLog(t *testing.T) {
|
|
||||||
log.Println(app.Logger)
|
|
||||||
app.InitLogger()
|
|
||||||
app.Logger.Debug("debug 日志")
|
|
||||||
app.Logger.Sugar().Debug("debug 日志")
|
|
||||||
app.Logger.Info("info 日志")
|
|
||||||
app.Logger.Sugar().Info("info 日志")
|
|
||||||
app.Logger.Warn("warning 日志")
|
|
||||||
app.Logger.Sugar().Warn("warning 日志")
|
|
||||||
app.Logger.Error("error 日志")
|
|
||||||
app.Logger.Sugar().Error("error 日志")
|
|
||||||
log.Println(app.Logger)
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
package gomd5
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestMd5(t *testing.T) {
|
|
||||||
t.Logf(GetMD5Encode("测试"))
|
|
||||||
t.Logf(ToUpper(GetMD5Encode("测试")))
|
|
||||||
t.Logf(ToUpper("测试"))
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
package gopreg
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestName(t *testing.T) {
|
|
||||||
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
package gorandom
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestAlphanumeric(t *testing.T) {
|
|
||||||
fmt.Println(Alphanumeric(10))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAlphabetic(t *testing.T) {
|
|
||||||
fmt.Println(Alphabetic(10))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestNumeric(t *testing.T) {
|
|
||||||
fmt.Println(Numeric(10))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAscii(t *testing.T) {
|
|
||||||
fmt.Println(Ascii(10))
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package gorequest
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestExternalIp(t *testing.T) {
|
|
||||||
t.Log(ExternalIp())
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package gossh
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestClient(t *testing.T) {
|
|
||||||
//Tunnel("root", "", ":22", ":3306", "localhost:13306")
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
package gostring
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestName(t *testing.T) {
|
|
||||||
str := "iPhone 11 Pro Max<iPhone12,5>"
|
|
||||||
fmt.Printf("%d\n", strings.LastIndex(str, "<"))
|
|
||||||
fmt.Printf("%d\n", strings.LastIndex(str, "("))
|
|
||||||
fmt.Printf("%d\n", strings.LastIndex("iPad (6th generation, WiFi)<iPad7,5>", "<"))
|
|
||||||
fmt.Printf("%d\n", strings.LastIndex("iPad (6th generation, WiFi)<iPad7,5>", "("))
|
|
||||||
s := str[0:17]
|
|
||||||
fmt.Printf("%s\n", s)
|
|
||||||
str = "iPad (6th generation, WiFi)<iPad7,5>"
|
|
||||||
s = str[0:5]
|
|
||||||
fmt.Printf("%s\n", s)
|
|
||||||
fmt.Printf(strings.TrimSpace(s))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestToInt64(t *testing.T) {
|
|
||||||
t.Log(ToInt64("120"))
|
|
||||||
t.Log(ToInt64("120.9"))
|
|
||||||
t.Log(strings.Contains("120", ","))
|
|
||||||
t.Log(strings.Contains("120,1", ","))
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestString(t *testing.T) {
|
|
||||||
str := "wx6566ef69e8738ad9"
|
|
||||||
fmt.Println(strings.Contains(str, "wx"))
|
|
||||||
myString := "www.dtapp.net"
|
|
||||||
if strings.HasPrefix(myString, "www") {
|
|
||||||
fmt.Println("Hello to you too")
|
|
||||||
} else {
|
|
||||||
fmt.Println("Goodbye")
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
package gourl
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestLenCode(t *testing.T) {
|
|
||||||
type args struct {
|
|
||||||
s string
|
|
||||||
}
|
|
||||||
tests := []struct {
|
|
||||||
name string
|
|
||||||
args args
|
|
||||||
want string
|
|
||||||
}{{
|
|
||||||
name: "https://www.dtapp.net",
|
|
||||||
}, {
|
|
||||||
name: "https://www.dtapp.net",
|
|
||||||
}, {
|
|
||||||
name: "https://www.dtapp.net",
|
|
||||||
}}
|
|
||||||
for _, tt := range tests {
|
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
|
||||||
start := time.Now()
|
|
||||||
t.Log(LenCode(tt.name))
|
|
||||||
elapsed := time.Since(start)
|
|
||||||
t.Log("run time", elapsed)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func BenchmarkLenCode(b *testing.B) {
|
|
||||||
for n := 0; n < b.N; n++ {
|
|
||||||
LenCode("https://www.dtapp.net")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDeCode(t *testing.T) {
|
|
||||||
type args struct {
|
|
||||||
s string
|
|
||||||
}
|
|
||||||
tests := []struct {
|
|
||||||
name string
|
|
||||||
args args
|
|
||||||
want string
|
|
||||||
}{{
|
|
||||||
name: "https%3A%2F%2Fwww.dtapp.net",
|
|
||||||
}, {
|
|
||||||
name: "https%3A%2F%2Fwww.dtapp.net",
|
|
||||||
}, {
|
|
||||||
name: "https%3A%2F%2Fwww.dtapp.net",
|
|
||||||
}}
|
|
||||||
for _, tt := range tests {
|
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
|
||||||
start := time.Now()
|
|
||||||
t.Log(DeCode(tt.name))
|
|
||||||
elapsed := time.Since(start)
|
|
||||||
t.Log("run time", elapsed)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func BenchmarkDeCode(b *testing.B) {
|
|
||||||
for n := 0; n < b.N; n++ {
|
|
||||||
DeCode("https%3A%2F%2Fwww.dtapp.net")
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
package gouuid
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGetUuId(t *testing.T) {
|
|
||||||
tests := []struct {
|
|
||||||
name string
|
|
||||||
want string
|
|
||||||
}{{}, {}, {}}
|
|
||||||
for _, tt := range tests {
|
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
|
||||||
t.Log(GetUuId())
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func BenchmarkGetUuId(b *testing.B) {
|
|
||||||
for n := 0; n < b.N; n++ {
|
|
||||||
GetUuId()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue