Skip to content

proposal: strconv: NumError implementing Unwrap #36325

@JOT85

Description

@JOT85

The strconv.NumError struct (https://golang.org/pkg/strconv/#NumError) contains the error which caused the conversion to fail in the Err field. It seems like it would be nice for NumError to implement the Unwrap() error method so that, for example, errors.Is(err, strconv.ErrRange) could be used. By exposing the struct field it is already part of the API and implementing the Unwrap method is a more convenient and standard way to use it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions