Skip to content
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

log/slog: examples can't be run on playground #69246

Open
haoxins opened this issue Sep 4, 2024 · 4 comments · May be fixed by #69249
Open

log/slog: examples can't be run on playground #69246

haoxins opened this issue Sep 4, 2024 · 4 comments · May be fixed by #69249
Assignees
Labels
Documentation FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@haoxins
Copy link
Contributor

haoxins commented Sep 4, 2024

What is the URL of the page with the issue?

https://pkg.go.dev/log/[email protected]#example-Handler-LevelHandler

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Screenshot

No response

What did you do?

When I run the example, it will panic with the error

What did you see happen?

package play
	prog.go:6:2: use of internal package log/slog/internal/slogtest not allowed

What did you expect to see?

the example should output the right result

@haoxins haoxins added the pkgsite label Sep 4, 2024
@gopherbot gopherbot added this to the Unreleased milestone Sep 4, 2024
@gabyhelp
Copy link

gabyhelp commented Sep 4, 2024

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@haoxins
Copy link
Contributor Author

haoxins commented Sep 4, 2024

There are multiple examples that use the "log/slog/internal/slogtest", the the links above do not fix all the examples.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610535 mentions this issue: log/slog: factoring out code to make the examples playable

@seankhliao seankhliao removed the pkgsite label Sep 4, 2024
@seankhliao seankhliao removed this from the Unreleased milestone Sep 4, 2024
@seankhliao seankhliao changed the title x/pkgsite: slog examples crashed because of internal package log/slog: examples can't be run on playground Sep 4, 2024
@dmitshur dmitshur added Documentation NeedsFix The path to resolution is known, but the work has not been done. labels Sep 4, 2024
@dmitshur dmitshur added this to the Backlog milestone Sep 4, 2024
@dmitshur dmitshur added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label Sep 4, 2024
@dmitshur
Copy link
Contributor

dmitshur commented Sep 4, 2024

CC @jba.

@jba jba self-assigned this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants