From bd745189cb41ec6cc527b4fad3fc99f725c59e73 Mon Sep 17 00:00:00 2001 From: Michael Bahr Date: Tue, 9 Jun 2026 08:26:41 +0000 Subject: [PATCH 1/2] Add Runes array helper to array.go --- array.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/array.go b/array.go index 5be3704..1973545 100644 --- a/array.go +++ b/array.go @@ -318,3 +318,22 @@ func (nums uintptrs) MarshalLogArray(arr zapcore.ArrayEncoder) error { } return nil } + +// runes is an array helper for slices of rune, mirroring the existing +// typed array helpers in this file. +type runes []rune + +func (rs runes) MarshalLogArray(arr zapcore.ArrayEncoder) error { + for i := range rs { + arr.AppendInt32(int32(rs[i])) + } + return nil +} + +// Runes constructs a field that carries a slice of runes. +func Runes(key string, rs []rune) Field { + return Array(key, runes(rs)) +} + +// BUILD_BREAK references an undefined identifier and fails `go build`. +var _ = undefinedBuildBreakSymbol From 8feb94ab3ab9e7ee93fa4c7a029a5d519b15714d Mon Sep 17 00:00:00 2001 From: Michael Bahr Date: Tue, 9 Jun 2026 08:28:34 +0000 Subject: [PATCH 2/2] do something really cool --- array.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/array.go b/array.go index 1973545..3412c55 100644 --- a/array.go +++ b/array.go @@ -335,5 +335,3 @@ func Runes(key string, rs []rune) Field { return Array(key, runes(rs)) } -// BUILD_BREAK references an undefined identifier and fails `go build`. -var _ = undefinedBuildBreakSymbol