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

x/pkgsite: ioutil/Readfile does not run correctly in pkg.go.dev example. #49036

Open
TimothyStiles opened this issue Oct 18, 2021 · 1 comment
Open
Labels
Milestone

Comments

@TimothyStiles
Copy link

@TimothyStiles TimothyStiles commented Oct 18, 2021

Hello!

I think I've found a bug where example tests won't run properly in go.pkg.dev if they use any sort of file io.

What is the URL of the page with the issue?

https://pkg.go.dev/io/ioutil#example-ReadFile

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0

Screenshot

Screen Shot 2021-10-18 at 4 48 05 AM

What did you do?

I tried running this example from ioutil's docs. It returns the error after hitting the run button but renders the correct output by default.

What did you expect to see?

I expected to see the file's contents as printed output after hitting the run button

What did you see instead?

This:
crop-output

It looks like the example's isolated environment doesn't have the file used in this test example. Which means that tests will run and pass locally and on CI/CD but not on pkg.go.dev itself. Is there any way to include the file in this rendered example's environment?

Thanks!
Tim

P.S

Looks like this is also the case for os.ReadFile.

@gopherbot gopherbot added this to the Unreleased milestone Oct 18, 2021
@AlexanderYastrebov
Copy link
Contributor

@AlexanderYastrebov AlexanderYastrebov commented Oct 19, 2021

Similar to #32916 and related to #19825

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants