Migrating to go modules with package name different from VCS

67 views
Skip to first unread message

Florent Viel

unread,
Feb 23, 2022, 8:54:25 AM2/23/22
to golang-nuts
Hello,

In my company, we are planning to migrate to go modules.
The package name and VCS URL will be redacted for confidentiality.

Our package name starts with `foobar.com/packagename` but the VCS URL to clone the repository is `gitlab.corp.foobar.com/foobar-groups/packagename`.

We have more than 200 repositories containing multiple go packages, so a package name rewrite is not an acceptable solution.

What can I do for the migration? Can I use go proxy?

Regards,

Sean Liao

unread,
Feb 23, 2022, 12:18:40 PM2/23/22
to golang-nuts
See https://pkg.go.dev/cmd/go#hdr-Remote_import_paths
specifically:

> The meta tag has the form:
> <meta name="go-import" content="import-prefix vcs repo-root">

If you serve the meta tags over HTTPS on the package path, you can point it to the appropriate git repo
Reply all
Reply to author
Forward
0 new messages