From 7681a0abf65fb2f6474f481702922cf52d170654 Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Tue, 30 Aug 2022 11:17:02 -0700 Subject: [PATCH] Export objectMarshalerPtr (#1171) We should export objectMarshalerPtr since it's exposed in a public API - ObjectValues[T any, P objectMarshalerPtr[T]]. --- array_go118.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/array_go118.go b/array_go118.go index ea94f9d75..d0d2c49d6 100644 --- a/array_go118.go +++ b/array_go118.go @@ -76,9 +76,9 @@ func (os objects[T]) MarshalLogArray(arr zapcore.ArrayEncoder) error { return nil } -// objectMarshalerPtr is a constraint that specifies that the given type +// ObjectMarshalerPtr is a constraint that specifies that the given type // implements zapcore.ObjectMarshaler on a pointer receiver. -type objectMarshalerPtr[T any] interface { +type ObjectMarshalerPtr[T any] interface { *T zapcore.ObjectMarshaler } @@ -105,11 +105,11 @@ type objectMarshalerPtr[T any] interface { // // var requests []*Request = ... // logger.Info("sending requests", zap.Objects("requests", requests)) -func ObjectValues[T any, P objectMarshalerPtr[T]](key string, values []T) Field { +func ObjectValues[T any, P ObjectMarshalerPtr[T]](key string, values []T) Field { return Array(key, objectValues[T, P](values)) } -type objectValues[T any, P objectMarshalerPtr[T]] []T +type objectValues[T any, P ObjectMarshalerPtr[T]] []T func (os objectValues[T, P]) MarshalLogArray(arr zapcore.ArrayEncoder) error { for i := range os {