Skip to content

errors: example code for errors.As has extraneous code #38369

@katiehockman

Description

@katiehockman

The example code for errors.As (viewed at https://pkg.go.dev/errors?tab=doc#As) is the entire contents of the wrap_test.go file. It should be just func ExampleAs() { ... } I presume.

In talking this over with @FiloSottile, this may be a more systemic issue which can be improved in godoc. For example, we have the same issue with the chacha20poly1305.NewX example code. However, perhaps we should fix the example for the errors package for now either way.

While we're in there, perhaps we should check if there are any improvements to the documentation for errors as tracked in #31716.

/cc @jba @mpvl

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions