Re:Go modules have a v2+ problem
by scns on Thursday September 10, 2020 @08:16AM
(#24431548)
In Elixir the code inside comments is tested so it cant go stale.
[ Parent
| on HN ]
In Go the example code is (can be) part of the source as well, and shown as executable in the documentation viewer: https://blog.golang.org/examples
Arguably another feature that could use some shouting from the rooftops. I see it fairly rarely from public packages, and it's something a lot of public packages really ought to have. Little example snippets for specific functions are great, but round-trip, top-to-bottom examples of using your code base are very useful.