This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Support revision
(version/tag) query params on Godoc handler for Sourcegraph usage redirection link
#15557
Labels
needs-team-triage
An issue without an owner. Issues should be labeled with a team's name. Malo's doing this.
Feature request description
I am currently working on this particular PR for this issue to implement Sourcegraph usage redirection link for pkg.go.dev like the way it currently is in godoc.org (short demo can be seen here).
Jonathan Amsterdam, one of the maintainers reminded me that pkg.go.dev supports revision/version for a particular Go package that was not implemented in godoc.org which means that this
revision
also needs to be implemented for the Sourcegraph usage redirection link for pkg.go.dev.Is your feature request related to a problem? If so, please describe.
The current Godoc handler does not support revision/version/tag yet for a particular Go package.
Describe alternatives you've considered.
The current Sourcegraph usage redirection handler for sirupsen/logrus's Printf will use this link from the godoc.org
https://sourcegraph.com/-/godoc/refs?def=Printf&pkg=github.com%2Fsirupsen%2Flogrus&repo=github.com%2Fsirupsen%2Flogrus&source=pkgsite
which will redirect to
http://sourcegraph.com/go/github.com/sirupsen/logrus/-/Printf
and then ended up on
https://sourcegraph.com/github.com/sirupsen/logrus/-/blob/exported.go#L193:6&tab=references
.The PR for this issue will support revision on the
repo
query param which means for a revision@v1.3.0
the link from the pkg.go.dev will yieldhttps://sourcegraph.com/-/godoc/refs?def=Printf&pkg=github.com%2Fsirupsen%2Flogrus&repo=github.com%2Fsirupsen%[email protected]&source=pkgsite
for the
serveGDDORefs
handler which will then redirect tohttp://sourcegraph.com/go/github.com/sirupsen/[email protected]/-/Printf
for the
serveGoSymbolURL
handler and then ended up onhttps://sourcegraph.com/github.com/sirupsen/[email protected]/-/blob/exported.go#L142:6&tab=references
.This is needed since the same
Printf
function are on different location/line for different revision/version (line 193 in the latest version and line 142 in the@v1.3.0
version).Additional context
@sqs kindly answered my questions for the Sourcegraph usage redirection link that I am currently working on and gave me really helpful pointers! Thank you so much! 🙂
The text was updated successfully, but these errors were encountered: