Skip to content

log/slog: ExampleDiscardHandler not shown on pkg site #70782

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

Closed
earthboundkid opened this issue Dec 11, 2024 · 3 comments
Closed

log/slog: ExampleDiscardHandler not shown on pkg site #70782

earthboundkid opened this issue Dec 11, 2024 · 3 comments
Assignees
Labels
Documentation Issues describing a change to documentation. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@earthboundkid
Copy link
Contributor

Go version

tip

Output of go env in your module/workspace:

n/a

What did you do?

Went to https://pkg.go.dev/log/slog@master#DiscardHandler

What did you see happen?

No example code

What did you expect to see?

The ExampleDiscardHandler from https://cs.opensource.google/go/go/+/master:src/log/slog/example_discard_test.go

@gopherbot gopherbot added the Documentation Issues describing a change to documentation. label Dec 11, 2024
@ianlancetaylor
Copy link
Member

Names like ExampleName are only attached to types and functions with those names. DiscardHandler is a variable. So I think the problem is that there is no place to attach ExampleDiscardHandler. Perhaps we should rename it to Example_DiscardHandler, so that it becomes a package-level example.

CC @jba

@jba
Copy link
Contributor

jba commented Dec 11, 2024

Agreed.

@jba jba self-assigned this Dec 11, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/635217 mentions this issue: log/slog: make DiscardHandler example package-level

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 11, 2024
@dmitshur dmitshur added this to the Go1.24 milestone Dec 11, 2024
@dmitshur dmitshur changed the title docs: log/slog: ExampleDiscardHandler not shown on pkg site log/slog: ExampleDiscardHandler not shown on pkg site Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues describing a change to documentation. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants