Skip to content

proposal: x/tools/cmd/deadcode: Notify OS of exit code 2,1 when unreachable code is found #66027

Closed as not planned
@Hyuga-Tsukui

Description

@Hyuga-Tsukui

Proposal Details

The deadcode command is quite useful but not well-suited for execution in automated environments such as CI. This is because, even when it discovers unreachable code, it only outputs the list of findings to standard error without sending an exit code.

In this proposal, I suggest properly implementing exit notifications to the OS for the deadcode command, motivated by its usage scenarios.

The implementation could be straightforward: at the end of the main function, simply call os.Exit(2) if the length of the output list of unreachable code is greater than zero.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions