cockroachdb / cockroachdb/errors

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

オープン
#87 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
2.5k
フォーク
74
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

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

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

評価

この issue はまだ評価されていません。

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

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