Skip to content

file.Any's unexported struct cannot be named 'any' — it shadows the predeclared identifier #650

Closed

Description

@David-Noble-at-work

blocks #645 (part 2, phase 5). Plan: sealed-provider-resources.md.

Ruling 3 gives the unexported struct the interface's lowercase name. That yields regular, directory, and symbolicLink without incident — and any for file.Any, which does not work.

any is a predeclared identifier (the alias for interface{}). Declaring a type by that name shadows it for the whole file package, so every use of any as a type in the package silently changes meaning. That includes the resource constructors' own signatures — DiscoverAny(runtimeEnvironment *op.RuntimeEnvironment, value any) — which would stop compiling or, worse, compile with the wrong type.

Decision needed before #645 starts

Candidates:

  1. anyEntry — the type's original name before AnyEntry: claims that assert existence, not kind #616 renamed it, so the vocabulary already exists in the design record and in reviewers' memory.
  2. anyResource — parallel to the resource base it embeds, and reads correctly beside regular/directory/symbolicLink.
  3. unasserted — names what the variant means (a claim asserting existence without asserting kind) rather than what it is called publicly. Most descriptive, least parallel.

Whichever is chosen, ruling 3's phrasing needs a carve-out recorded in the plan: the lowercase rule yields to Go's predeclared identifiers.

This is the only variant affected — Regular, Directory, and SymbolicLink lowercase cleanly.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions