pinecone-io / go-pinecone

Pinecone.io Golang Client
Apache License 2.0
49 stars 9 forks source link

[Bug] Unusual use of *context.Context #19

Closed robfig closed 5 months ago

robfig commented 7 months ago

Is this a new bug?

Current Behavior

Updating from v0.3 to v0.4, I like the new API, much easier to use. Nice work!

However, I did notice that the API methods all accept a *context.Context instead of a context.Context. That is highly unusual. Every other usage of context.Context inside the stdlib and other API clients is context.Context, which makes me think it was unintentional. Taking address-of to satisfy the interface is no big deal, but it does seem like an API design error.

Expected Behavior

Use context.Context, instead of a pointer to that interface.

Steps To Reproduce

N/A

Relevant log output

No response

Environment

- **OS**:
- **Language version**:
- **Pinecone client version**:

Additional Context

No response

austin-denoble commented 7 months ago

Thanks for the callout, @robfig. I think you're right, I've got a PR up to tweak the API: https://github.com/pinecone-io/go-pinecone/pull/20

Props to @haruska for getting the improved v0.4 client released!

austin-denoble commented 5 months ago

v0.5.0 has been released which should address this. Thanks again! https://github.com/pinecone-io/go-pinecone/releases/tag/v0.5.0