Skip to content

go/doc: example including go- prefixed packages not considered as playable #56740

@yoanm

Description

@yoanm

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 mypkg is playable
  • Second example for go-mypkg is not playable
  • But third example for go-mypkg using mypkg alias 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions