-
Notifications
You must be signed in to change notification settings - Fork 18k
slog: TextHandler crash with nil
TextMarshaller
#64034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It can also be noted that the two handlers handle a
And the text handler evaluating it:
|
https://go.dev/play/p/9XV1HnSDSUa?v=gotip Could try dev-branch, seems work fine. |
This was fixed by: #61648. |
Oh nice. Do you happen to know if that fix was also applied for exp/slog?
|
https://go.dev/play/p/8Z9QN5CU5yq?v=gotip It is not fixed there. |
Yeah, just saw. |
We (go-ethereum) are trying to move over to I'm not quite sure how the |
Normally exp is unsupported, but we'll keep exp/slog working until the next release. |
Seems fixed as of v0.0.0-20231110203233-9a3e6036ecaa |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?triggers on play.golang.org
What did you do?
The
slog
package texthandler panics for certain cases ofnil
, specifically if the object being nil is aTextMarshaller
. Other types ofnil
values are handled, as far as I can tell, and the json handler handles this case fine, so it seems to be that it's a bug.Repro
Output
Crashing code
The text was updated successfully, but these errors were encountered: