Skip to content

cmd/go: clarify that special directories can still be used for package paths #24732

Closed as not planned
@dlsniper

Description

@dlsniper

Hi,

The current documentation is a bit unfortunate when it comes to the special directories understood by the go tool.

https://golang.org/cmd/go/#hdr-Test_packages

The go tool will ignore a directory named "testdata", making it available to hold ancillary data needed by the tests.

https://golang.org/cmd/go/#hdr-Package_lists

Directory and file names that begin with "." or "_" are ignored by the go tool, as are directories named "testdata".

However, those directories can currently be used just as well for compiling. Unfortunately, I don't have a better wording yet that would describe that only certain operations will behave in this special mode for these special rules/directories.

This comes up often enough as tooling can suggest completion symbols from these directories then users can interpret this as a problem with the tooling rather than special cases in certain go tool usages.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions