Skip to content

Example codes in the documents must be complete #207

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
aidin-gh opened this issue Feb 28, 2020 · 5 comments
Closed

Example codes in the documents must be complete #207

aidin-gh opened this issue Feb 28, 2020 · 5 comments
Labels
Milestone

Comments

@aidin-gh
Copy link

For example, in the Echo Example, echoServer and client functions aren't defined. It's not obvious how one should define them.

Also, it seems like a good idea to have an example directory in the source tree with all the examples in it. So, instead of having to copy and paste from docs, examples are just there next to the source code someone downloaded, and can be compile and run. Or, they can be explored right through the Github's Web UI.

@nhooyr
Copy link
Contributor

nhooyr commented Feb 28, 2020

@nhooyr nhooyr added the docs label Feb 28, 2020
@nhooyr
Copy link
Contributor

nhooyr commented Feb 28, 2020

Mhmm yea if you run godoc -http=:8085 locally then the example shows up properly 😕

@nhooyr
Copy link
Contributor

nhooyr commented Feb 28, 2020

Reported to the go team, turns out full file examples don't show up correctly if you only have functions. Adding a type fixed it in my test repo https://github.com/nhooyr/websocket3

cc @julieqiu

@nhooyr
Copy link
Contributor

nhooyr commented Feb 28, 2020

I'll clarify the docs in the meantime that the examples can be found on GitHub.

@aidin-gh
Copy link
Author

aidin-gh commented Mar 1, 2020

Awesome. Thanks.

@nhooyr nhooyr added this to the v1.8.5 milestone Apr 13, 2020
@nhooyr nhooyr closed this as completed in b307b47 Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants