Skip to content

x/tools/godoc: Allow shallow directory listing #27666

Closed as not planned
Closed as not planned
@seeruk

Description

@seeruk

I've been looking into setting up a godoc server internally, but my team and I agreed that browsing godoc is not easy when you have a large $GOPATH. The issue we've experienced comes down to how sub-directories and sub-packages are listed, i.e. directories within directories, and packages within packages are shown. The result is that you end up being forced to use your browser's "Find" functionality to find what you're looking for on the extremely long and hard to follow pages.

Another problem caused by this is that it makes loads the packages homepage a lot slower, because the page can get quite long - even on pretty beefy hardware.

I took a quick look around in the godoc code and found what seems to be a sensible place to put a new option for how packages and sub-directories are displayed and made a fork with the change in over here. I'll submit a PR for that too, but from the contribution guide it looks like I should also submit an issue that it can be linked to.

All this does is allow you to add ?m=shallow to the URL, and it'll only show the top level packages and directories for whatever you're looking at.

Another change I did have in mind was that it'd be nice to specify default PageInfoMode values when godoc starts so you don't always have to add it to the URL, but I've not had chance to look into that yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions