Build a SaaS app with Go eBook

1 min read Original article ↗

We use Go's interface for the data package

When I initially came up with the table of contents for the book I picked MongoDB as the database for no particular reason other than the ease of changing the data model.

That created some debate in the community. I decided to create the data package with both implementations for MongoDB and PostgreSQL. There's also an in-memory data store used for integration tests.

This chapter shows excellent use of Go's interface, and hopefully, you will reuse the concepts elsewhere in your future applications. We're also covering build tags to compile specific implementations of the data package.

Buy now