From 5046887df28e7cfaa7409a6c041c96a71dc1fbc8 Mon Sep 17 00:00:00 2001 From: sourcegraph Date: Mon, 8 Jun 2026 18:48:33 +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 89365d14619ecf5afbd7dabe3b69c7b88e8fcafa Mon Sep 17 00:00:00 2001 From: sourcegraph Date: Mon, 8 Jun 2026 18:51:00 +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