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: separate commands from packages in directory listing #3199

Open
ugorji opened this Issue Mar 5, 2012 · 13 comments

Comments

Projects
None yet
5 participants
@ugorji
Contributor

ugorji commented Mar 5, 2012

This is a follow-up to the really nice update from Russ with CL:
http://golang.org/cl/5711058/

It will be nice to separate user ($GOPATH) commands from packages in directory listing.
One way to do this is to show user commands (from $GOPATH/src/cmd/*) in Commands view,
and not in Packages view.

godoc currently handles user packages found in $GOPATH nicely, by putting user packages
alongside built-in packages, so one sees all the packages available to him.

In the same vein, it will be nice if godoc can handle commands, by putting user commands
alongside built-in commands. 

For example, suppose you have:
  $GOPATH/src/{pkg1...n}
  $GOPATH/src/cmd/{cmd1...n}

It will be nice if godoc skips showing anything under src/cmd in the
"Packages" view (ie skip cmd/{cmd1...n}), and show stuff under src/cmd/
({cmd1...n}) in the "Commands" view. 

Currently, I see my commands in the Packages view, and the import line is wrong, and
there's really no extra information it gives, since I can't use the command code in any
other packages (so it ends up adding clutter).

To illustrate further, in my codebase, when I run godoc, I see my commands somewhere in
the middle of the pack, below my b###.net/* and bytes packages and before
code.google.com/* packages. It's very easy to miss (especially with the comfortable
spacing style), and you wouldn't realize those are not actually packages, but commands.
I then click the "Commands" link where I'd expect to see them, but see only
the standard ones (like go, gofmt, vet, yacc, etc). 

(This suggestion is limited to godoc alone; the definition of $GOPATH and its
interaction with go command shouldn't be affected)

##################### DETOUR ######################
It will also be nice if there's a quick link above Packages/Commands views to:
  .. (up one directory level) 
  Packages
  Commands

Currently, the .. is way at the bottom (along with Sub Directories), and to get to
Packages or Commands listing, you have to click References at the top and start over.


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux

Which revision are you using?  (hg identify)
ba91b34fe212+ tip

Please provide any additional information below.
@ugorji

This comment has been minimized.

Contributor

ugorji commented Mar 5, 2012

Comment 1:

P.S. I'm willing to work on it if the team wants me to, after agreeing on how things
should work.
@rsc

This comment has been minimized.

Contributor

rsc commented Mar 5, 2012

Comment 2:

Thanks.  If this is going to happen for Go 1 we'll
pick it up as part of other godoc work; otherwise,
after Go 1 feel free to send a CL.
Russ
@rsc

This comment has been minimized.

Contributor

rsc commented Mar 7, 2012

Comment 3:

Labels changed: added priority-go1, removed priority-triage.

Status changed to Accepted.

@rsc

This comment has been minimized.

Contributor

rsc commented Mar 8, 2012

Comment 4:

I looked at this but it is non-trivial.  It will need to wait until after Go 1.

Labels changed: added priority-later, removed priority-go1.

@rsc

This comment has been minimized.

Contributor

rsc commented Sep 12, 2012

Comment 5:

Labels changed: added go1.1maybe.

@mewmew

This comment has been minimized.

Contributor

mewmew commented Feb 10, 2013

Comment 6:

As far as I can tell, this issue is a duplicate of issue #3579.
Instead of using magic directories such as "src/cmd/" for commands it would be favorable
to distinguish them based on package name ("main" is always a command.)
Otherwise commands with import paths such as "src/github.com/user/repo/commandname"
would not be recognized.
@robpike

This comment has been minimized.

Contributor

robpike commented Mar 7, 2013

Comment 7:

Labels changed: removed go1.1maybe.

@adg

This comment has been minimized.

Contributor

adg commented Mar 8, 2013

Comment 8:

Issue #3579 has been merged into this issue.

@rsc

This comment has been minimized.

Contributor

rsc commented Mar 12, 2013

Comment 9:

[The time for maybe has passed.]
@adg

This comment has been minimized.

Contributor

adg commented Mar 18, 2013

Comment 10:

Labels changed: added godoc.

@rsc

This comment has been minimized.

Contributor

rsc commented Nov 27, 2013

Comment 11:

Labels changed: added go1.3maybe.

@rsc

This comment has been minimized.

Contributor

rsc commented Dec 4, 2013

Comment 12:

Labels changed: added release-none, removed go1.3maybe.

@rsc

This comment has been minimized.

Contributor

rsc commented Dec 4, 2013

Comment 13:

Labels changed: added repo-tools.

@ugorji ugorji added accepted labels Dec 4, 2013

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc changed the title from cmd/godoc: separate commands from packages in directory listing to x/tools/cmd/godoc: separate commands from packages in directory listing Apr 14, 2015

@rsc rsc removed the repo-tools label Apr 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment