Our great sponsors
-
use some lib that facilitates SQL generation, like Squirrel
-
db.go - contains the interfaces, structs, and constructors
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
For that, I used the lib go-sqlmock. So, for example, the following snippet is part of the person/service_test.go file:
-
I will present in this post a project that fits in the last category: sqlc.
-
Implement the Repository interface by writing the queries in code, perhaps using some solution like Squirrel or sqlx.
-
SonarLint
Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.