Skip to content

proposal: cmd/cover: report untested nil values entry-points #17272

Closed
@henvic

Description

@henvic

Given that null references cause so much unexpected trouble, what about reporting untested entry points that could cause nil point panics on the code coverage report?

This could be limited to public functions and show as a small flag on the HTML reports.

Example:

...
var projects, err = repo.GetProjects() [nil]
...

where [nil] would actually be a report flag saying this code wasn't covered with a nil return for this value.

Reference: Null References: The Billion Dollar Mistake

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions