Is there a way to get an unchanging URL that always redirects to the latest major version of a package on
pkg.go.dev?
Right now, if I go to
I get the documentation for either v0 or v1 of a package, which is out of date if there's a more recent major version.
What I would like is a URL that given $PACKAGE_NAME always redirects to the latest major version of that package. For example, a URL something like
which would redirect to
if the latest major version of $PACKAGE_NAME is v2.
The reasons for this request are:
1. I'm usually using the latest version of the package, and so I want to see the docs for the most recent version.
2. If users stumble across documentation for an old major version by default then there's a risk that they'll use or evaluate the old major version by default. Usually there's a good reason why users should not be using the old major version.
Right now,
pkg.go.dev displays a tiny black text on a grey background line at the top of the page that says something like:
The highest tagged major version is v61.
See
https://pkg.go.dev/github.com/google/go-github for an example. This is extremely easy to miss. Alternatively, this banner should be in big red letters - if you're using this version of the module then you're probably doing something wrong.
If there's support for this new URL and/or the banner usability improvement, then I'd be happy to contribute a fix.
Thoughts?
Regards,
Tom