var _errArrayElemPool … // Error is shorthand for the common idiom NamedError("error", err). func Error(err error) Field { … } // NamedError constructs a field that lazily stores err.Error() under the // provided key. Errors which also implement fmt.Formatter (like those produced // by github.com/pkg/errors) will also have their verbose representation stored // under key+"Verbose". If passed a nil error, the field is a no-op. // // For the common case in which the key is simply "error", the Error function // is shorter and less repetitive. func NamedError(key string, err error) Field { … } type errArray … func (errs errArray) MarshalLogArray(arr zapcore.ArrayEncoder) error { … } type errArrayElem … func (e *errArrayElem) MarshalLogObject(enc zapcore.ObjectEncoder) error { … }