All six examples on pkg.go.dev failed to run. They import internal/tracetest to get MustClean, the playground builds them as their own module, and internal packages aren't importable from there. Readers also see that import in the code block, which is useless to them since they can't use it either.
So the examples have to be self-contained, stdlib plus errtrace, everything they touch in the same file. Do we need MustClean in the doc examples?
All six examples on pkg.go.dev failed to run. They import internal/tracetest to get MustClean, the playground builds them as their own module, and internal packages aren't importable from there. Readers also see that import in the code block, which is useless to them since they can't use it either.
So the examples have to be self-contained, stdlib plus errtrace, everything they touch in the same file. Do we need MustClean in the doc examples?