My gut is that if we implement this, we should either do something lower-level (e.g., go-import specific, like GitLFS) or higher-level (e.g., intercept and mangle any request).
Technically, you can sort of already do the latter by subclassing
PhabricatorSite and creating a high-priority site which intercepts requests and steals them before
PhabricatorPlatformSite, although this is more work and somewhat dangerous (if we fix bugs or make changes in
Site would keep working the wrong way by default).
Also, given that we have a package management application, I’m not entirely sure this integration makes sense in Diffusion at all. Aligning on
go get https://phabricator/package/crypto for package metadata probably makes more sense as a long-term direction than
go get https://phabricator/source/crypto.