Skip to content

Commit 8b1565c

Browse files
committedJul 10, 2024··
feat: when the name is empty, WithGroup returns the receiver
1 parent 6ca8ce8 commit 8b1565c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎handler.go

+5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ func (h *FormatterHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
5454

5555
// WithGroup implements slog.Handler.
5656
func (h *FormatterHandler) WithGroup(name string) slog.Handler {
57+
// https://cs.opensource.google/go/x/exp/+/46b07846:slog/handler.go;l=247
58+
if name == "" {
59+
return h
60+
}
61+
5762
return &FormatterHandler{
5863
groups: append(h.groups, name),
5964
formatters: h.formatters,

0 commit comments

Comments
 (0)
Please sign in to comment.