c/golang · by austin@programming.dev · 3yGo’s best-kept secret: executable examples https://bitfieldconsulting.com/golang/examples21 points · 5 comments · view on lemmy.world
5 Comments
otl@lemmy.sdf.org · 5 pts · 3y
There's also Testable Examples in Go from the official Go blog.
morgen@infosec.pub · 4 pts · 3y
I have not seen this before. Thanks for sharing. Do you know any projects that utilize this, so I can see an example implementation of this?
otl@lemmy.sdf.org · 2 pts · 3y
The sort package in the standard library uses testable examples (source code).
RandomDevOpsDude@programming.dev · 2 pts · 3y
ExampleEcho
going to
func Echodoc Example(and many more)
austin@programming.dev · 1 pts · 3y
The go stdlib uses it a lot. For example, the strings package