Skip to content

Commit 2c92ff8

Browse files
matttproudgopherbot
authored andcommitted
_content/blog: cross-reference context articles
This change cross-references the context.md and context-and-structs.md articles with each other with the addition of the conventional "Further reading" sections. The context-and-structs.md article has been somewhat of a singleton article without being referenced from the other one, and it would be worth providing a hair more exposure given the subtleties of the API. Change-Id: Ifadcf6ec3f9cc47fff1e63f6841b7705fd018a4f GitHub-Last-Rev: 7361271 GitHub-Pull-Request: #299 Reviewed-on: https://go-review.googlesource.com/c/website/+/616495 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent fa72e5e commit 2c92ff8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

_content/blog/context-and-structs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,7 @@ Context makes it easy to propagate important cross-library and cross-API informa
144144
When passed as the first argument in a method rather than stored in a struct type, users can take full advantage of its extensibility in order to build a powerful tree of cancellation, deadline, and metadata information through the call stack. And, best of all, its scope is clearly understood when it's passed in as an argument, leading to clear comprehension and debuggability up and down the stack.
145145

146146
When designing an API with context, remember the advice: pass `context.Context` in as an argument; don't store it in structs.
147+
148+
## Further reading
149+
150+
- [Go Concurrency Patterns: Context (2014 blog post)](context.md)

_content/blog/context.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,8 @@ Their client libraries would then accept a `Context` from the calling code.
228228
By establishing a common interface for request-scoped data and cancellation,
229229
`Context` makes it easier for package developers to share code for creating
230230
scalable services.
231+
232+
## Further reading
233+
234+
- [Go Concurrency Patterns: Pipelines and cancellation (2014 blog post)](pipelines.md)
235+
- [Contexts and structs (2021 blog post)](context-and-structs.md)

0 commit comments

Comments
 (0)