Skip to content

Commit 7681a0a

Browse files
authored
Export objectMarshalerPtr (#1171)
We should export objectMarshalerPtr since it's exposed in a public API - ObjectValues[T any, P objectMarshalerPtr[T]].
1 parent 9abd14b commit 7681a0a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

array_go118.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ func (os objects[T]) MarshalLogArray(arr zapcore.ArrayEncoder) error {
7676
return nil
7777
}
7878

79-
// objectMarshalerPtr is a constraint that specifies that the given type
79+
// ObjectMarshalerPtr is a constraint that specifies that the given type
8080
// implements zapcore.ObjectMarshaler on a pointer receiver.
81-
type objectMarshalerPtr[T any] interface {
81+
type ObjectMarshalerPtr[T any] interface {
8282
*T
8383
zapcore.ObjectMarshaler
8484
}
@@ -105,11 +105,11 @@ type objectMarshalerPtr[T any] interface {
105105
//
106106
// var requests []*Request = ...
107107
// logger.Info("sending requests", zap.Objects("requests", requests))
108-
func ObjectValues[T any, P objectMarshalerPtr[T]](key string, values []T) Field {
108+
func ObjectValues[T any, P ObjectMarshalerPtr[T]](key string, values []T) Field {
109109
return Array(key, objectValues[T, P](values))
110110
}
111111

112-
type objectValues[T any, P objectMarshalerPtr[T]] []T
112+
type objectValues[T any, P ObjectMarshalerPtr[T]] []T
113113

114114
func (os objectValues[T, P]) MarshalLogArray(arr zapcore.ArrayEncoder) error {
115115
for i := range os {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy