cmd/doc: match major module versions greater than 1 without needing a /vN suffix #41501
Comments
I will file more issues as I find them. I was just wondering if there was a larger meta-issue I had missed. To be clear, I haven't found other problems yet. It might all be working fine. |
I'm really surprised that noone has spotted this before. I assume this is a mix of not enough people knowing how to use I agree this needs a fix. At first glance it doesn't sound too complex, so perhaps it's a good first issue for someone wanting to get into In terms of a fix, perhaps we can use the package name for the lookup. That way, |
@mvdan, I like the idea of using the |
Sorry, what do you mean? Reading or parsing source files seems strictly more expensive than just opening the files. As far as I know, |
Sorry, s/reading/listing/. I think |
Simply using the last component of the package path, with a heuristic to remove |
What version of Go are you using (
go version
)?I'm using Go 1.15, but I confirmed that none of the behavior I describe below is any different as of
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?N/A
What did you do?
I have a module which uses
github.com/go-chi/chi/v4
as a dependency. Thego.mod
contains(And it doesn't involve any other module or package named
chi
.)Inside this module, I was trying to use
go doc
to review some documentation for this dependency.What did you expect to see?
I should be able to use the name
chi
to call up package docs forgithub.com/go-chi/chi/v4
:What did you see instead?
The name
chi
is not enough to getgo doc
to bring up package docs forgithub.com/go-chi/chi/v4
. I need to refer to it aschi/v4
:By the way, is there some other issue tracking more general
go doc
improvements to better work with modules? I notice thatgo help doc
only mentionsGOPATH
, not modules, so I suspect that there might be more work required in this area.The text was updated successfully, but these errors were encountered: