Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replacexerrors with our own customerrors library so that we have one import whilst supporting new Go 1.20 features #5288

Open
Labels
apiArea: HTTP API
@mafredri

Description

@mafredri

Go 1.20 will include two new functions in theerrors package,Join andSplit.

golang/go@787f816

Two problems:

  1. We usexerrors which most likelywill not be updated to support these new functions
    • The package is not only missing the new functions, it also has it's own implementations ofIs andAs which won't support the new functionality
  2. Typingxerrors is unnatural for a Go developer and we often end up with a mix oferrors andxerrors

We usexerrors only because they include stack traces.

Proposal: We create our own in-projecterrors package (github.com/coder/coder/errors) where we wrap most of thestdliberrors functions except those where we want to extend the error with stack traces.

Ways to accomplish this:

  • Forkxerrors and rename togithub.com/coder/errors (outside project), bring in line with stdlib
  • Write our own stack handling, based onxerrors,pkg/errors or similar previous work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP API

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp