Skip to content

Allow runners to forbid time.Duration casting on expressions of integer type #1

@ImprintNav

Description

@ImprintNav

Casting integers to time.Duration is usually as incorrect as implicitly assigning integer expressions to constants, variables, fields, and parameters of type time.Duration. You can usually replace instances of time.Duration(x) with x * time.Nanoseconds if you really want to convert your type into nanoseconds.

There should be an analyzer flag which, when enabled, also forbids explicit casts to time.Duration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions