From 4574e9ab7470c6f7dc2adb3763dffb9e6b2c5132 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 2 Mar 2020 15:25:25 +0300 Subject: [PATCH] logger/zap: fix invalid field allocation Signed-off-by: Vasiliy Tolstov --- zap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zap.go b/zap.go index fdba9f0..c997ee2 100644 --- a/zap.go +++ b/zap.go @@ -68,7 +68,7 @@ func (l *zaplog) Init(opts ...logger.Option) error { } func (l *zaplog) Fields(fields map[string]interface{}) logger.Logger { - data := make([]zap.Field, len(fields)) + data := make([]zap.Field, 0, len(fields)) for k, v := range fields { data = append(data, zap.Any(k, v)) }