|
|
|
|
|
by schmichael
1243 days ago
|
|
Context is a dependency like any other parameter in a function call. I don't think we should start conflating that with coloring which is distinct from normal parameters: function colors are the result of using language-specific keywords (async, await, yield, etc). These keywords are implemented with compile-time and/or runtime-time support. Context on the other hand is just Go code like any other Go code, and used as a convention, and quite a loose one at that. You can opt out of it with "Background()" at any point. Also I probably see contexts used as much for supervisor/component management as IO. Most of the stdlib IO APIs lack Context support: - the io and os packages have 0 references to context - the "net" package has contexts for dns and making connections, but reads and writes don't use contexts |
|