Skip to content

x/pkgsite: possible change in how example links work #48707

@ianlancetaylor

Description

@ianlancetaylor

https://golang.org/cl/353391 points out that a link in Effective Go () does not work. The link is https://golang.org/pkg/strings/#example_Map. That link currently just goes to the docs for the strings package. If we change the underscore to a hyphen (https://golang.org/pkg/strings/#example-Map) then it links to the example.

The link has been there since 2013 (added in https://golang.org/cl/7454044) and it seems to me unlkely that nobody ever checked that the link worked. While I can't prove it, it seems much more likely that this broke when golang.org was moved over to pkg.go.dev.

It seems to me that we should make the underscore links work for examples, unless there is some good reason not to. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.pkgsite

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions