diff --git a/.gitignore b/.gitignore index 2b895f41..40c63141 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ .idea .vscode *.log -gitmod.sh \ No newline at end of file +gitmod.sh +/service/*/*_test.go +/utils/goredis/*_test.go diff --git a/service/dingdanxia/jd.jy_order_details_test.go b/service/dingdanxia/jd.jy_order_details_test.go deleted file mode 100644 index ad2631ed..00000000 --- a/service/dingdanxia/jd.jy_order_details_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package dingdanxia - -import ( - "gopkg.in/dtapps/go-library.v3/utils/gotime" - "log" - "testing" -) - -func TestApp_JdJyOrderDetails(t *testing.T) { - param := NewParams() - param.Set("startTime", gotime.Current().BeforeDay(28).Timestamp()) - param.Set("endTime", gotime.Current().Timestamp()) - param.Set("itemsPerPage", 60) - param.Set("curPage", 1) - param.Set("type", 1) - log.Printf("%+v\n", app.JdJyOrderDetails(param)) -} diff --git a/service/dingdanxia/waimai.meituan_orders_test.go b/service/dingdanxia/waimai.meituan_orders_test.go deleted file mode 100644 index 0b894e21..00000000 --- a/service/dingdanxia/waimai.meituan_orders_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package dingdanxia - -import ( - "gopkg.in/dtapps/go-library.v3/utils/gotime" - "log" - "testing" -) - -func TestApp_WaimaiMeituanOrders(t *testing.T) { - param := NewParams() - param.Set("start_time", gotime.Current().BeforeDay(28).Timestamp()) - param.Set("end_time", gotime.Current().Timestamp()) - log.Printf("%+v\n", app.WaimaiMeituanOrders(param)) -} diff --git a/service/ip/app_test.go b/service/ip/app_test.go deleted file mode 100644 index 72cde392..00000000 --- a/service/ip/app_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package ip - -import ( - "net" - "testing" -) - -var app App - -func TestIp(t *testing.T) { - t.Log(net.ParseIP("61.241.55.180").To4()) - t.Log(net.ParseIP("240e:3b4:38e4:3295:7093:af6c:e545:f2e9").To16()) - t.Log(app.V4db.Find("61.241.55.180")) - t.Log(app.V6db.Find("240e:3b4:38e4:3295:7093:af6c:e545:f2e9")) - t.Log(app.V4Region.MemorySearch("61.241.55.180")) -} diff --git a/service/wechatminiprogram/getcallbackip_test.go b/service/wechatminiprogram/getcallbackip_test.go deleted file mode 100644 index eb6faa89..00000000 --- a/service/wechatminiprogram/getcallbackip_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package wechatminiprogram - -import ( - "testing" -) - -func TestApp_GetCallBackIp(t *testing.T) { - t.Log(app) - result := app.GetCallBackIp() - t.Logf("Response:%s", result.GetCallBackIpResponse) - t.Logf("Err:%s", result.Err) - t.Logf("Byte:%v", result.Byte) -} diff --git a/service/wechatoffice/getcallbackip_test.go b/service/wechatoffice/getcallbackip_test.go deleted file mode 100644 index 24f05959..00000000 --- a/service/wechatoffice/getcallbackip_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package wechatoffice - -import ( - "testing" -) - -func TestApp_GetCallBackIp(t *testing.T) { - t.Log(app) - result := app.GetCallBackIp() - t.Logf("Response:%s", result.GetCallBackIpResponse) - t.Logf("Err:%s", result.Err) - t.Logf("Byte:%v", result.Byte) -} diff --git a/utils/golog/golog_test.go b/utils/golog/golog_test.go new file mode 100644 index 00000000..7591db30 --- /dev/null +++ b/utils/golog/golog_test.go @@ -0,0 +1,33 @@ +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) +}