Developing a Go API client: the do's and don'ts

Maintaining an open-source API client takes some effort. Not only do you have to reflect the API, you also want to provide the best developer experience possible. This talk is about best practices you should use when writing Go API clients while maintaining flexibility & stability in the long term.

Abstract

Maintaining an open-source API client takes some effort. Not only do you have to reflect the API, you also want to provide the best developer experience possible. This talk is about best practices you should use when writing Go API clients while maintaining flexibility & stability in the long term.

Algolia’s core product is a distributed search API; therefore, it must provide a developer-friendly and stable API client. Thanks to what we’ve learned from our users and our own experiences, we’re going to discuss best practices on how to reach those goals when designing and implementing a Go API client.
Compared to other programming languages, which offer looser constraints (typing system, more granular control over visibility, etc.) or more high-level abstractions (genericity, default arguments, etc.), Go feels minimal. To provide high-quality packages, you have to be creative. When it was time to release the new major version of our Go API client, we made sure to explore and use every possible feature of the language, as well as its tooling, to provide a state-of-the-art library.

In this talk, we’ll cover, among other topics:
•How to plan for backward-compatibility
•Why Go generics are not always needed
•Providing flexible and public API
•How useful the empty interface can be
•Using channels sparingly
•Designing a fast and concurrent testing suite for integration tests

Video

Stay connected

You can subscribe to our newsletter to stay updated on the latest news and announcements. Follow us on social media to join our community and engage with other attendees, speakers, and staff. We're on Twitter, Mastodon, Youtube and Facebook. Don't forget to use our official hashtag #GoLab2023 to share your experience and connect with other attendees on social media.

Subscribe to our newsletter

We hate spam just as much as you do, which is why we promise to only send you relevant communications. We respect your privacy and will never share your information with third parties.
©2023 GoLab | The international conference on Go in Florence-Design & devCantiere Creativo-Made withDatoCMS