Skip to content

go1.26: replace errors.As with errors.AsType #8541

@aarongable

Description

@aarongable

The new errors.AsType uses Go's generics rather than reflection, so it is faster, easier to use, and gives compile-time rather than runtime errors. It seems likely that we can use it as a drop-in replacement everywhere, although it may require sweeping changes across our test code.

Read more: https://antonz.org/go-1-26/#errors-astype, https://go.dev/issue/51945

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions