Skip to content

x/tools/cmd/vet: complain about incomplete switch statements #5469

@robpike

Description

@robpike
From the mailing list:

A year ago, around Google I/O, we were talking about Go
wishlist items and it came up that some people miss having
a compiler that checks switch case coverage (like some C
compilers do with enums). As I recall, Rob said it doesn't
belong in the compiler (naturally) but would be a good
addition to go vet.

Not sure about the details, but I think the general idea would
be to have go vet report a problem when some but not all
values from a const block are used as cases in a switch.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions