On Saturday, November 18, 2017 at 1:54:51 PM UTC-8, Axel Wagner wrote: > > Given that there should be exactly one call to context.Background per > binary (in func main()), I don't understand the problem this is trying to > solve. Similarly, context.TODO might be used, but should be used > temporarily, as a migration tool, so it shouldn't matter that much. >
Fair point. context.C as a function argument everywhere was the impetus for the idea, context.Bg was an afterthought. Also, that's not true in all my code. Maybe I'm doing it wrong, but I use Background a lot in tests and sometimes I use it with a timeout that is not tied to the parent context in order to, for example, give a routine 10 seconds to do cleanup/shutdown, or 10 seconds to make a client connection to a service. -- 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. For more options, visit https://groups.google.com/d/optout.