-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/doc: support -mod=readonly and other build flags #35200
Comments
Coincidentally, @rentziass just sent out CL 203609 today, which adds support for a |
Ok thx going to test this as soon as possible to figure out if gopls can be used as a replacement of go doc in a short amount of time :) #32875 |
Please correct me if am wrong but https://go-review.googlesource.com/c/tools/+/203609/1/internal/lsp/cmd/symbols.go doesn't support modules, only input files located on your disk, so to be able to do what go doc does by first downloading the module and then look up a specific symbol or give a overview of all symbols of that specific module requires a lot more work I guess. |
This part is working as intended.
This part is covered by #33710. Also related: #32027. cc @bcmills |
Ok kind of agree, but you don't have the mod readonly flag in
Anyway you are right this is more like a duplicate of #33710 |
That's true, we should probably add that and most of the other relevant build flags. I'll reopen this issue for that. |
Now that |
|
We were bit by this recently. godoc will mutate the go.sum unless told otherwise, which means when run locally things appear to work fine, but if run remotely on a readonly filesystem they fail. It looks like the other go commands now run in readonly mode by default, should godoc do that as well? It's surprising it'll fix up things automatically. |
@esprehn, now that I'd like to keep this issue focused on flag support (for example, using |
Currently the other godoc html tool need significant changes before module support is ready. Also gopls has a long way to go to be a reliable tool for inspecting modules documentation which leave us with go doc to be the only tool we have for inspect modules.
What needs to be done for go doc specifically so that we have at least one reliable tool is:
A) go doc should never update
go.mod
files which it does and also does if cd is in GOPATH (related to #35070)B) go doc should not require any
go.mod
file to be present in current working directory to inspect any existing module espacialy whenGO111MODULE
is always set toon
The text was updated successfully, but these errors were encountered: