go
go copied to clipboard
go/doc: example including `go-` prefixed packages not considered as playable
What version of Go are you using (go version)?
go 1.19
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
Playground env
What did you do?
See https://go.dev/play/p/SPW5ePcwU2Y
What did you expect to see?
The three examples should be playable
What did you see instead?
Example including go- prefixed packages not rendered as playable example, unless use of totally useless explicit alias
- First example for
mypkgis playable - Second example for
go-mypkgis not playable - But third example for
go-mypkgusingmypkgalias is playable
Additional information
Issue might come from there, as import path contains go- prefix, it doesn't match the package name at runtime (where go- prefix is automatically removed), therefore related package is considered as unresolved, which leads to the whole example not considered playable.
One solution might be to trim go- prefix before that line