エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント3件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Alternative to using context.Value
I love context.Context. But I don’t like using context.Value(). Because it relies on using interf... I love context.Context. But I don’t like using context.Value(). Because it relies on using interface{}, it requires the programmers to write a possibly panic-inducing type assertion like this: func foo(ctx context.Context) { v := ctx.Value(key).(*MyThing) // eek ... }Obviously it’s possible to avoid the panic by using a two return value form of type assertion, but that just adds more code for each
2017/03/29 リンク