Skip to content

Commit cbd979a

Browse files
katevisamber
andauthored
Return receiver in WithGroups method when name is empty (#5)
* Return receiver in WithGroups method when name is empty * Update handler.go --------- Co-authored-by: Samuel Berthe <[email protected]>
1 parent d253dd8 commit cbd979a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

handler.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ func (h *SyslogHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
9797
}
9898

9999
func (h *SyslogHandler) WithGroup(name string) slog.Handler {
100+
// https://cs.opensource.google/go/x/exp/+/46b07846:slog/handler.go;l=247
101+
if name == "" {
102+
return h
103+
}
104+
100105
return &SyslogHandler{
101106
option: h.option,
102107
attrs: h.attrs,

0 commit comments

Comments
 (0)