Skip to content

cmd/go: go doc's -all and -short flags don't work together #77191

Description

@cespare

Go version

go version go1.25.1 linux/amd64

Output of go env in your module/workspace:

not relevant

What did you do?

I ran several commands:

  • go doc -all runtime/metrics
  • go doc -short runtime/metrics
  • go doc -all -short runtime/metrics

What did you see happen?

With -all -short, go doc behaved the exact same way as with just -all. In other words, it seemed to ignore -short entirely and printed out all the documentation text.

What did you expect to see?

I think that -all -short should display the full API without documentation. I was looking for a quick way to get a concise text summary of the API surface and I was surprised that -all -short didn't work.

Alternatively, if -all and -short aren't supposed to work together, that should be documented and the tool should exit with a usage error rather than ignoring -short entirely.

I also filed an issue for a possibly-related -short bug at #77192.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions