Skip to content

x/pkgsite: variable DiscardHandler not listed under Variables in log/slog #74312

@ArnoSen

Description

@ArnoSen

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

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.pkgsite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions