Skip to content

x/pkgsite: ioutil.Discard appears but io.Discard does not #72798

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
pjebs opened this issue Mar 11, 2025 · 4 comments
Closed

x/pkgsite: ioutil.Discard appears but io.Discard does not #72798

pjebs opened this issue Mar 11, 2025 · 4 comments
Labels
Documentation Issues describing a change to documentation. pkgsite
Milestone

Comments

@pjebs
Copy link
Contributor

pjebs commented Mar 11, 2025

What is the URL of the page with the issue?

https://pkg.go.dev/io

What is your user agent?

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

Screenshot

From ioutil docs:
Image

From io docs:
Image

What did you do?

N/A

What did you see happen?

N/A

What did you expect to see?

I expected to see io.Discard listed in variables section

@pjebs pjebs added the pkgsite label Mar 11, 2025
@gopherbot gopherbot added this to the Unreleased milestone Mar 11, 2025
@magical
Copy link
Contributor

magical commented Mar 11, 2025

It seems to be filed under Writer: https://pkg.go.dev/io#Writer

Image

@pjebs
Copy link
Contributor Author

pjebs commented Mar 11, 2025

Yes but why the inconsistency. In ioutil it's under Variables. in io it's hidden as a comment under Writer. You have to already know Discard is a Writer to possibly even find it.

It doesn't even show up in the Index so it's hard to even find it.

@seankhliao
Copy link
Member

same as #39813

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2025
@magical
Copy link
Contributor

magical commented Mar 11, 2025

Yes but why the inconsistency. In ioutil it's under Variables. in io it's hidden as a comment under Writer. You have to already know Discard is a Writer to possibly even find it.

I don't like it either, but i know the reason: It's because variables of a type defined in the same package are grouped with that type. Writer is defined in io, so Discard is grouped with it. ioutil does not define Writer, so the Discard variable there goes in the top section.

It doesn't even show up in the Index.

No variables are added to the index.

@gabyhelp gabyhelp added the Documentation Issues describing a change to documentation. label Mar 11, 2025
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. pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants