Assuming a recent enough version of `godoc`, running it from within a 
module should include the documentation for the standard library (standard 
library section), that module, and all its dependencies (third party 
section)
Expected output should be similar to:

$ godoc
using module mode; GOMOD=/home/arccy/testrepo-337/go.mod

It doesn't handle documentation across multiple, unrelated modules, but you 
could work around it by defining a dummy package & module with imports to 
the modules you wish to include (use replace to point to the local version) 
and running `godoc` from the dummy module

On Sunday, March 28, 2021 at 4:01:37 PM UTC+2 Hotei wrote:

> Clarification.  As mentioned earlier, $GOPATH is supposed to go away in 
> the (possibly near) future so one of my main goals is to get it working 
> outside the $GOPATH tree.  At present my solution has been to copy my 
> source tree (about 4 GB) to a "non-module-aware" go ecosystem on a 
> different machine and browse over my local network to the old godoc version 
> there.    While it works (for the moment) it's not a very efficient or 
> maintainable solution.  The possibility of easy to maintain documentation 
> has always been one of go's strengths thanks to gofmt and godoc.  Hate to 
> lose half that advantage if there's a way around it.
> David Rook
>
> On Sunday, March 28, 2021 at 7:05:01 AM UTC-4 m8il...@gmail.com wrote:
>
>> I found you had to cd to each directory with a .mod file and run it 
>> there. A global option would be nice to know about.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/79476439-6459-42e9-bf6c-27f4ad962744n%40googlegroups.com.

Reply via email to