一種獲取context中keys和values的高效方法 | golang
- 2021 年 1 月 23 日
- 筆記
我们知道,在 golang 中的 context 是一个非常重要的包,保存了代码活动的上下文。我们经常使用 WithValue() 这个方法,来往 context 中 传递一些 key value 数据。 如果我们想拿到 context 中所有的 key and value 或者在不知道 key 的 …
Continue Reading我们知道,在 golang 中的 context 是一个非常重要的包,保存了代码活动的上下文。我们经常使用 WithValue() 这个方法,来往 context 中 传递一些 key value 数据。 如果我们想拿到 context 中所有的 key and value 或者在不知道 key 的 …
Continue Reading