Re: [go-nuts] Re: context.C and context.BG

2017-11-18 Thread Alex Buchanan
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 > tempo

Re: [go-nuts] Re: context.C and context.BG

2017-11-18 Thread 'Axel Wagner' via golang-nuts
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. (Regarding context.C,

Re: [go-nuts] Re: context.C and context.BG

2017-11-18 Thread Alex Buchanan
So, context.Bg could be a value then? context.TODO could stay a function. On Saturday, November 18, 2017 at 6:01:07 AM UTC-8, Sameer Ajmani wrote: > > Context.TODO and Background have different String values; see > emptyCtx.String. > On Fri, Nov 17, 2017 at 9:25 PM me via golang-nuts < > golan...

Re: [go-nuts] Re: context.C and context.BG

2017-11-18 Thread 'Anmol Sethi' via golang-nuts
Ah, thanks! > On Nov 18, 2017, at 9:00 AM, Sameer Ajmani wrote: > > Context.TODO and Background have different String values; see emptyCtx.String. > On Fri, Nov 17, 2017 at 9:25 PM me via golang-nuts > mailto:golang-nuts@googlegroups.com>> wrote: > I've found a hint. Apparently, both context.TO

Re: [go-nuts] Re: context.C and context.BG

2017-11-18 Thread Sameer Ajmani
Context.TODO and Background have different String values; see emptyCtx.String. On Fri, Nov 17, 2017 at 9:25 PM me via golang-nuts < golang-nuts@googlegroups.com> wrote: > I've found a hint. Apparently, both context.TODO and context.Background > share a common implementation but they need distinct

[go-nuts] Re: context.C and context.BG

2017-11-17 Thread me via golang-nuts
I've found a hint. Apparently, both context.TODO and context.Background share a common implementation but they need distinct addresses. See https://golang.org/src/context/context.go#L168 So they cannot be constants because then they would not have an address. They cannot be variables because th