-
Notifications
You must be signed in to change notification settings - Fork 302
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
Inline part of the full examples #440
Comments
If you follow the link comment you'll see the example. If not please let me know. Worked for me just tried it. |
I code Go both professionally and personally, and this is the first time I have ever seen an example like this: package main
import ()
func main() {
// https://github.com/nhooyr/websocket/tree/master/internal/examples/echo
} why not just code the examples inline, like the rest: |
It's a multi file example with tests. Such examples cannot be effectively included inline with godoc. At least not to my knowledge. |
Perhaps it would be worth having the echo.go file inline though and also link to the full runnable example. |
I mean if you are getting to the point where you examples are multiple files, it might be better to just link to the GitHub folder where the example are. but just do a normal link to the folder, putting a link inside a Go program just seems wrong. |
Problem is such links are not easily identifiable unless you read the full godoc which many people do not do. This way, it's easily identifiable as part of the godoc UI. |
OK, well put the link/links the VERY top of the doc, that way its unlikely to be missed |
https://godocs.io/nhooyr.io/websocket#example-package-Echo
https://godocs.io/nhooyr.io/websocket#example-package-FullStackChat
The text was updated successfully, but these errors were encountered: