Skip to content

x/tools/go/analysis/passes/tests: should it re-use go/doc's example classification logic, or continue to implement its own? #36184

Closed
@dmitshur

Description

@dmitshur

A part of the functionality in the function checkExample parses the name of the example and reports if it refers to an unknown identifier, field, or method.

Before #23864 was resolved, there was no choice but for tests to implement this logic itself. Now that #23864 is resolved, it may be possible for tests to reuse some of the logic from go/doc in Go 1.14 and newer.

This issue is to investigate and answer the question of: should it? Would it be better to reuse that logic, or is it better to continue to implement the example naming classification a second time for the needs of tests?

Note that the text of diagnostics that the tests pass emits should not be made worse if this implementation change were to happen.

/cc @jayconrod @matloob @bcmills

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions