Giter VIP home page Giter VIP logo

Comments (7)

nhooyr avatar nhooyr commented on August 26, 2024

If you follow the link comment you'll see the example.

If not please let me know. Worked for me just tried it.

from websocket.

3052 avatar 3052 commented on August 26, 2024

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:
https://godocs.io/nhooyr.io/websocket#example-package-CrossOrigin

from websocket.

nhooyr avatar nhooyr commented on August 26, 2024

It's a multi file example with tests. Such examples cannot be effectively included inline with godoc. At least not to my knowledge.

from websocket.

nhooyr avatar nhooyr commented on August 26, 2024

Perhaps it would be worth having the echo.go file inline though and also link to the full runnable example.

from websocket.

3052 avatar 3052 commented on August 26, 2024

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.

from websocket.

nhooyr avatar nhooyr commented on August 26, 2024

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.

from websocket.

3052 avatar 3052 commented on August 26, 2024

OK, well put the link/links the VERY top of the doc, that way its unlikely to be missed

from websocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.