[go-nuts] Re: Context on one-shot structs

2021-01-15 Thread Ross Light
The Go CDK stores a Context in a struct while performing I/O: https://pkg.go.dev/gocloud.dev/blob#Bucket.NewWriter It could be argued that this is done for compatibility with the io.Reader and io.Writer interfaces. However, I think this pattern, used sparingly, is suitable for API interactions

[go-nuts] Re: Context on one-shot structs

2021-01-12 Thread 'Jean de Klerk' via golang-nuts
Er, lifetime of the struct * On Tue, Jan 12, 2021 at 8:11 AM Jean de Klerk wrote: > Hi all, > > I'm looking into how contexts are used, and wondering: does anybody know > of an idiomatic use of context on a struct for the sake of a one-shot? > > (a one-shot being some struct that gets used once,