Skip to content

godoc: confusing error when searching for packages from the command line #1514

@mirtchovski

Description

@mirtchovski
Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. on the command line type "godoc test"

What is the expected output?
An error message saying that no such package was found

What do you see instead?
An error message saying that no such command was found

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

Which operating system are you using?
All

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


Please provide any additional information below.

When invoked from the command line, the godoc program will first search the package
directories for the supplied argument. If a package was not found godoc will treat the
user argument as a command instead of a package and search go/src/cmd. Unfortunately, if
it doesn't find anything there either it will only report that it hasn't found the
command, and will say nothing about the missing package error. This causes people new to
the language to exclaim "but i was looking for a package?!"

NB: I hesitate to submit the attached patch as a CL as I'm not sure it is good enough.

Attachments:

  1. godoc.patch (1232 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions