huandu / go-clone

Clone any Go data structure deeply and thoroughly.
https://pkg.go.dev/github.com/huandu/go-clone
MIT License
305 stars 28 forks source link

can not copy *zap.Logger #1

Closed romberli closed 3 years ago

romberli commented 3 years ago

import ( clone "github.com/huandu/go-clone" "go.uber.org/zap" "go.uber.org/zap/zapcore" )

func CloneLogger(logger zap.Logger) zap.Logger { return clone.Clone(logger) }

it will pacnic with message below: panic: reflect.Value.Convert: value of type int8 cannot be converted to type zapcore.LevelEnabler

any help is appreciated.

huandu commented 3 years ago

Fixed. Thanks for reporting this issue to me.