Forum Discussion

lloyd's avatar
lloyd
New Contributor
4 years ago

Why "linger" a context.Context in the codegen Go client?

Hi all,

Does anyone know why the go client generates the following code for each API?

// Linger please
var (
_ context.Context
)

The documentation for the context package doesn't mention any behind the scenes machinery that would benefit from this code construct and in fact it strongly implies that programs should not try and store long lived Context objects. I've Googled for this code construct elsewhere and I don't see anything.

Cheers

No RepliesBe the first to reply