logger/zap: fix invalid field allocation

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-03-02 15:25:25 +03:00
parent bcfeeafd2b
commit 4574e9ab74

2
zap.go
View File

@ -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))
}