-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
What is the URL of the page with the issue?
https://pkg.go.dev/log/slog#pkg-variables
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Screenshot
What did you do?
During code review, I wanted to share a colleague a link to the newly added DiscardHandler. While searching in my browser for it, I quickly learned that it was a variable and I wanted to send him a link to the variable so I went to the variable section but that was empty.
What did you see happen?
I was expecting to see DiscardHandler in the list of variables.
Also i could not find it in the object tree.
What did you expect to see?
I expected to see the variable mentioned under the Variables section or somewhere else in the object tree.
Now that I had a closer look also variables in other packages are not consistently added to the variables section (e.g net/http/DefaultTransport) . Maybe the policy is to only list variables that 'deserve' to be mentioned in the variables list but sometimes (like now) I found this confusing.
As a suggestion variables could also be added under the types header so In this case it would go under Handler (https://pkg.go.dev/log/slog#Handler) like also is done for constructors.