aboutsummaryrefslogtreecommitdiff
path: root/src/log
diff options
context:
space:
mode:
authorJes Cok <xigua67damn@gmail.com>2023-12-05 04:12:45 +0000
committerJonathan Amsterdam <jba@google.com>2023-12-05 18:18:13 +0000
commitaf5d544b6d847e1610132aa6301afd2c2cd77d9f (patch)
tree4f93f485739c64d8fcad7b4794d5ab2484f7b977 /src/log
parent285ef16b3872faccb877abaef5e481a630acdaf2 (diff)
downloadgo-af5d544b6d847e1610132aa6301afd2c2cd77d9f.tar.gz
go-af5d544b6d847e1610132aa6301afd2c2cd77d9f.zip
log/slog: correct doc examples for Handler.WithGroup
Fixes #64519 Change-Id: Iaea5de74402b77eb5a42979bd3baa1276b13d585 GitHub-Last-Rev: 5080a257b2d7aa7c4333d05bdef0b5dcbb0449ed GitHub-Pull-Request: golang/go#64551 Reviewed-on: https://go-review.googlesource.com/c/go/+/547215 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jes Cok <xigua67damn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/log')
-rw-r--r--src/log/slog/handler.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/log/slog/handler.go b/src/log/slog/handler.go
index 2182bfb609..2ff85b582e 100644
--- a/src/log/slog/handler.go
+++ b/src/log/slog/handler.go
@@ -76,11 +76,11 @@ type Handler interface {
// A Handler should treat WithGroup as starting a Group of Attrs that ends
// at the end of the log event. That is,
//
- // logger.WithGroup("s").LogAttrs(level, msg, slog.Int("a", 1), slog.Int("b", 2))
+ // logger.WithGroup("s").LogAttrs(ctx, level, msg, slog.Int("a", 1), slog.Int("b", 2))
//
// should behave like
//
- // logger.LogAttrs(level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2)))
+ // logger.LogAttrs(ctx, level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2)))
//
// If the name is empty, WithGroup returns the receiver.
WithGroup(name string) Handler