From 3a872a2262de47cb921e3ae3da6e4487ba652129 Mon Sep 17 00:00:00 2001 From: nilsocket Date: Sun, 16 Apr 2023 14:51:22 +0530 Subject: [PATCH] slog: fix grammatical mistakes in docs Change-Id: I183dda71fcec04fc1e622c66f719bd745d8b4eea Reviewed-on: https://go-review.googlesource.com/c/go/+/484975 TryBot-Result: Gopher Robot Auto-Submit: Carlos Amedee Reviewed-by: Bryan Mills Reviewed-by: Rob Pike Run-TryBot: Rob Pike Reviewed-by: Carlos Amedee Reviewed-by: Hyang-Ah Hana Kim --- src/log/slog/doc.go | 4 ++-- src/log/slog/handler.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/log/slog/doc.go b/src/log/slog/doc.go index 3b37eec0d2..5ca14b735b 100644 --- a/src/log/slog/doc.go +++ b/src/log/slog/doc.go @@ -64,7 +64,7 @@ produces this output: {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} -Both [TextHandler] and [JSONHandler] can be configured with a [HandlerOptions]. +Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. There are options for setting the minimum level (see Levels, below), displaying the source file and line of the log call, and modifying attributes before they are logged. @@ -199,7 +199,7 @@ so even if it uses the common key "id", the log line will have distinct keys. Some handlers may wish to include information from the [context.Context] that is available at the call site. One example of such information -is the identifier for the current span when tracing is is enabled. +is the identifier for the current span when tracing is enabled. The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first argument, as do their corresponding top-level functions. diff --git a/src/log/slog/handler.go b/src/log/slog/handler.go index 2adaf56724..47c7fd2782 100644 --- a/src/log/slog/handler.go +++ b/src/log/slog/handler.go @@ -40,7 +40,7 @@ type Handler interface { Enabled(context.Context, Level) bool // Handle handles the Record. - // It will only be called Enabled returns true. + // It will only be called when Enabled returns true. // The Context argument is as for Enabled. // It is present solely to provide Handlers access to the context's values. // Canceling the context should not affect record processing. @@ -401,7 +401,6 @@ func (s *handleState) openGroup(name string) { if s.groups != nil { *s.groups = append(*s.groups, name) } - } // closeGroup ends the group with the given name. -- 2.50.0