You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In at least one case (NewWriter), blob saves a context for later use.
ctx is passed to NewWriter
If new opt.ContentType is provided, it saves the ctx in the returned *Writer.
That ctx may be used later as part of a call to Write or to Close (which don't take a Context argument).
The Context documentation says "Do not store Contexts inside a struct type", so this is kind of a no-no, but I'm not sure how to avoid it. There's a proposal to add Context args to Write and Close, but that's speculative and unlikely to happen soon.
We should at least clearly document the behavior.
The text was updated successfully, but these errors were encountered:
zombiezen
changed the title
Clearly document cases where blob saves a Context for later use
blob: clearly document cases where blob saves a Context for later use
Aug 1, 2018
In at least one case (NewWriter), blob saves a context for later use.
The Context documentation says "Do not store Contexts inside a struct type", so this is kind of a no-no, but I'm not sure how to avoid it. There's a proposal to add Context args to Write and Close, but that's speculative and unlikely to happen soon.
We should at least clearly document the behavior.
The text was updated successfully, but these errors were encountered: