diff options
| author | Jonathan Amsterdam <jba@google.com> | 2023-05-18 09:24:42 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2023-05-22 18:27:07 +0000 |
| commit | bc96901e8959c5eb21d5bca5614eb66481815918 (patch) | |
| tree | 6897ccd2017d7ac4bf3f994a6979301911de45e6 /src/cmd | |
| parent | 6d4d71c5abe104d95ede3aa2f3eaaef7bc613ebb (diff) | |
| download | go-bc96901e8959c5eb21d5bca5614eb66481815918.tar.xz | |
log/slog: empty calls to With and WithGroup are no-ops
It doesn't make sense to call Logger.WithGroup with the empty string.
Make it a no-op by returning the receiver.
This relieves handlers of the burden of detecting that case themselves.
Less importantly, but for consistency, if Logger.With is called with
no args, make it a no-op by returning the receiver.
Along the way, fix obsolete mentions of "the Logger's context" in the
doc.
Change-Id: Ia6caa4f1ca70c1c4b0cab3e222b2fda48be73fef
Reviewed-on: https://go-review.googlesource.com/c/go/+/496175
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'src/cmd')
0 files changed, 0 insertions, 0 deletions
