Skip to content

os: example shows deprecated function #46976

@eliben

Description

@eliben

This is a documentation issue.

One of the examples in the os packages shows the usage of the IsNotExist function; however, this function's documentation recommends avoiding it in new code:

This function predates errors.Is. It only supports errors returned by the os package. New code should use errors.Is(err, os.ErrNotExist).

It seems like the example should be updated to demonstrate the new way of checking for this error instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions