From 5080a257b2d7aa7c4333d05bdef0b5dcbb0449ed Mon Sep 17 00:00:00 2001 From: Jes Cok Date: Tue, 5 Dec 2023 12:05:36 +0800 Subject: [PATCH] log/slog: correct doc examples for Handler.WithGroup Fixes #64519 --- src/log/slog/handler.go | 4 ++-- 1 file 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