package passkey import "context" type contextKey int const key contextKey = 0 // NewContext adds a Passkey structure to a context and returns the new context func NewContext(ctx context.Context, pk *Client) context.Context { return context.WithValue(ctx, key, pk) } // FromContext extracts a Passkey structure from a context and returns it func FromContext(ctx context.Context) *Client { return ctx.Value(key).(*Client) }