Closed ungerik closed 8 months ago
Hm… probably not the change I would have made… but probably a change for the better… 🤔
P.S.: That is to say, I would have limited the scope of the change rather than plumb a context everywhere. But then, the context should probably be there anyways, so. 🤷♀️
It has become a reflex to add ctx everywhere. So far it never turned out that there were too many ctx in any code base, if there were problems then because of not enough ctx ;-)
But I can rewrite the PR if you want...
No, there is no need to rewrite, I don’t think the plumbed context will cause any performance issues.
Added method
Client.ReadDirContext
to be able to cancel long-running dir listings.The passed context can cancel the operation returning all entries listed up to the cancellation.