4 ms·
A language specific answer: The testing package of the Go standard library has a built-in support for examples. They are executed as part of the tests, but are
by ithkuil 7y ago
A language specific answer: The testing package of the Go standard library has a built-in support for examples. They are executed as part of the tests, but are rendered by the documentation generator as examples. This obviously only solves the problem of library writes that want to expose examples of library usage (and ensure they don't get stale)
- adamhepner 7y agoThis is such an amazing feature. I wish it got picked up by other major languages and became a standard practice.