From 0f4edca6d1038926e5fe303c71b3c4c8cf5e8122 Mon Sep 17 00:00:00 2001 From: zkqiang Date: Sat, 4 Jul 2020 12:14:45 +0800 Subject: [PATCH] compatible with go1.12 --- backend/middlewares/es_log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/middlewares/es_log.go b/backend/middlewares/es_log.go index 1dff344e..464a2a0a 100644 --- a/backend/middlewares/es_log.go +++ b/backend/middlewares/es_log.go @@ -23,7 +23,7 @@ func EsLog(ctx context.Context, esClient *elastic.Client) gin.HandlerFunc { // 结束时间 end := time.Now() //执行时间 - latency := strconv.FormatInt(int64(end.Sub(start).Milliseconds()), 10) + latency := strconv.FormatInt(end.Sub(start).Nanoseconds()/1000, 10) path := c.Request.URL.Path clientIP := c.ClientIP()