You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation for latest (v0.0.0-20230522175609-2e198f4a06a1) version of HandlersOptions.ReplaceAttr says:
If ReplaceAttr returns an Attr with Key == "", the attribute is discarded.
This is counter-intuitive (because Handler.Handle docs discard zero attribute instead), prevent returning group attrs with empty key to embed group, and didn't match actual behaviour of current implementation (which is correct: it discards zero Attr and handles Attr with empty Key but non-zero Value).
Looks like docs should be fixed to match current implementation.
(Maybe golang.org/x/exp/slog docs needs similar fix.)
The text was updated successfully, but these errors were encountered:
dmitshur
changed the title
x/exp/slog: Fix HandlersOptions.ReplaceAttr documentation when attribute is discarded
log/slog: fix HandlersOptions.ReplaceAttr documentation when attribute is discarded
Jun 21, 2023
It said that Attrs with an empty key are ignored.
In fact, zero Attrs are ignored.
Fixesgolang#60870.
Change-Id: I221d3a25b0f0cc9001e06e9cc76bab29292c0741
Reviewed-on: https://go-review.googlesource.com/c/go/+/504535
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
eric
pushed a commit
to fancybits/go
that referenced
this issue
Sep 7, 2023
It said that Attrs with an empty key are ignored.
In fact, zero Attrs are ignored.
Fixesgolang#60870.
Change-Id: I221d3a25b0f0cc9001e06e9cc76bab29292c0741
Reviewed-on: https://go-review.googlesource.com/c/go/+/504535
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
eric
pushed a commit
to fancybits/go
that referenced
this issue
Sep 7, 2023
It said that Attrs with an empty key are ignored.
In fact, zero Attrs are ignored.
Fixesgolang#60870.
Change-Id: I221d3a25b0f0cc9001e06e9cc76bab29292c0741
Reviewed-on: https://go-review.googlesource.com/c/go/+/504535
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Documentation for latest (v0.0.0-20230522175609-2e198f4a06a1) version of HandlersOptions.ReplaceAttr says:
This is counter-intuitive (because Handler.Handle docs discard zero attribute instead), prevent returning group attrs with empty key to embed group, and didn't match actual behaviour of current implementation (which is correct: it discards zero Attr and handles Attr with empty Key but non-zero Value).
Looks like docs should be fixed to match current implementation.
(Maybe golang.org/x/exp/slog docs needs similar fix.)
The text was updated successfully, but these errors were encountered: