Skip to content
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

x/tools/cmd/godoc: synopsis for subdirectories is always empty #22646

Closed
arp242 opened this issue Nov 9, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@arp242
Copy link

commented Nov 9, 2017

When using godoc the synopsis for the subdirectories is always empty.

For example:

$ godoc -html github.com/jmoiron/sqlx | tail -n35
                                    <tr>
                                            <td class="pkg-name" style="padding-left: 0px;">
                                                    <a href="reflectx/">reflectx</a>
                                            </td>
                                            <td class="pkg-synopsis">

                                            </td>
                                    </tr>

                                    <tr>
                                            <td class="pkg-name" style="padding-left: 0px;">
                                                    <a href="types/">types</a>
                                            </td>
                                            <td class="pkg-synopsis">

                                            </td>
                                    </tr>

The same when leaving -html out, although I'm not sure if it's supposed to be displayed here?

$ godoc github.com/jmoiron/sqlx | tail -n6
SUBDIRECTORIES

        reflectx
        types

If I run godoc -http :6061 and navigate to http://localhost:6061/pkg/github.com/jmoiron/sqlx/ it does work as expected (like on e.g. https://www.godoc.org/github.com/jmoiron/sqlx).

This problem is not specific to the sqlx package; it happens with all packages. I just used this as an example.

Using Go 1.9.2 with most recent godoc (commit 05e91d0/Nov 7).

@agnivade

This comment has been minimized.

Copy link
Member

commented Feb 1, 2018

Thanks, I am able to repro this. I know why this is happening. The http mode and the command line code paths are different. The http mode creates a dir tree for the entire GOPATH, whereas in command line mode, the dir tree for only that path is created with a depth of 1. Hence the synopses of sub-directories are not retrieved. We just need to go one level deeper.

Will send a CL when 1.11 cycle opens.

@gopherbot

This comment has been minimized.

Copy link

commented Feb 13, 2018

Change https://golang.org/cl/93675 mentions this issue: godoc: show synopses for subdirectories in package view

@golang golang locked and limited conversation to collaborators Feb 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.