package migrationAPI import "context" type contextKey int const key contextKey = 0 // NewContext adds the client into the context and returns the modified context func NewContext(ctx context.Context, client *Client) context.Context { return context.WithValue(ctx, key, client) } // FromContext retrieves the client from the context func FromContext(ctx context.Context) *Client { return ctx.Value(key).(*Client) }