summaryrefslogtreecommitdiff
path: root/plugins/logger/zap_adapter.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/logger/zap_adapter.go')
-rw-r--r--plugins/logger/zap_adapter.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/logger/zap_adapter.go b/plugins/logger/zap_adapter.go
index 0a0855b8..6d865519 100644
--- a/plugins/logger/zap_adapter.go
+++ b/plugins/logger/zap_adapter.go
@@ -23,7 +23,7 @@ func (log *ZapAdapter) fields(keyvals []interface{}) []zap.Field {
return []zap.Field{zap.Error(fmt.Errorf("odd number of keyvals pairs: %v", keyvals))}
}
- var fields []zap.Field
+ fields := make([]zap.Field, 0, len(keyvals)/2)
for i := 0; i < len(keyvals); i += 2 {
key, ok := keyvals[i].(string)
if !ok {