package coreAPI import "context" type contextKey int const key contextKey = 0 // NewContext will create a new insert an instance of Client into a new context and return that context func NewContext(ctx context.Context, c *Client) context.Context { return context.WithValue(ctx, key, c) } // FromContext will extract and instance of Client out of a given context and return the Client func FromContext(ctx context.Context) *Client { return ctx.Value(key).(*Client) }