Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Decode context.Canceled, context.DeadlineExceeded etc as a reference to the stdlib instance

オープン
#87 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go

調査の方向性

まず、issue で言及されている leaf decoder を読み、ネットワーク経由で転送された標準ライブラリのエラーがどのように再構築されるかをたどってください。context.Canceled と context.DeadlineExceeded がどのように表現されるかを確認し、次に、デコードによって標準ライブラリのインスタンスが返され、== による比較が成功することを検証してください。

索引モデルが issue の本文から書いたものです。

説明

Currently, instances of the stdlib errors trasnferred over the network are decoded into an object of the same type/value, but not the same instance. So reference comparisons with == with the stdlib instance fail.

This matters for e.g. context.Context.Err() which describes in its API doc that it returns the standrd errors unwrapped so it's legitimate for a caller to use ==.

We could address that by adding a special case in the leaf decoder, so that if a leaf is one of the known stdlib errors, we return the stdlib instance instead.

主要言語
Go
スター
2.5k
フォーク
75
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cockroachdb/errors のほかの issue

cockroachdb/errors の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。