Skip to content

Commit af5d544

Browse files
callthingsoffjba
authored andcommitted
log/slog: correct doc examples for Handler.WithGroup
Fixes #64519 Change-Id: Iaea5de74402b77eb5a42979bd3baa1276b13d585 GitHub-Last-Rev: 5080a25 GitHub-Pull-Request: #64551 Reviewed-on: https://go-review.googlesource.com/c/go/+/547215 Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]> Run-TryBot: Jes Cok <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 285ef16 commit af5d544

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/log/slog/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ type Handler interface {
7676
// A Handler should treat WithGroup as starting a Group of Attrs that ends
7777
// at the end of the log event. That is,
7878
//
79-
// logger.WithGroup("s").LogAttrs(level, msg, slog.Int("a", 1), slog.Int("b", 2))
79+
// logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2))
8080
//
8181
// should behave like
8282
//
83-
// logger.LogAttrs(level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2)))
83+
// logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2)))
8484
//
8585
// If the name is empty, WithGroup returns the receiver.
8686
WithGroup(name string) Handler

0 commit comments

Comments
 (0)