Skip to content

proposal: cmd/go: enable remote import path wildcards #54530

@willfaught

Description

@willfaught

The go command documentation says if you want import "example.com/pkg" to work for https://github.com/myuser/pkg, you have to put <meta name="go-import" content="example.com/pkg git https://github.com/myuser/pkg"> in the HTML for https://example.com/pkg and https://example.com.

It seems you have to do this for each package, which is painful, especially if example.com serves static content, like a Hugo site on GitHub Pages.

There should be a way to have a single meta tag like <meta name="go-import" content="example.com/* git https://github.com/myuser/*"> in the site root's HTML that acts as a wildcard for any import path.

I guess you could have things like fallbacks too:

<meta name="go-import" content="example.com/pkg git https://github.com/myuser/pkg">
<meta name="go-import" content="example.com/* git https://github.com/someotheruser/*">

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions