On Wednesday, 13 August 2025 at 23:59:37 UTC+6 Peter Bočan wrote: if we could include a method on the Context interface called "Cancelled() bool" which would simply return a boolean value if the context was somewhere somehow cancelled?
Not saying that it helps in this case, but I think context.Err() gives you what you asked for. // If Done is not yet closed, Err returns nil. // If Done is closed, Err returns a non-nil error explaining why: // DeadlineExceeded if the context's deadline passed, // or Canceled if the context was canceled for some other reason. // After Err returns a non-nil error, successive calls to Err return the same error. Err() error -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/d74090b6-04c3-41ce-a01d-485426751940n%40googlegroups.com.