database/sql provides a generic interface for SQL which drivers use to build their libraries. You can switch from one postgres driver like pq to pgx easily because they both support database/sql.
[0]: https://github.com/jackc/pgx#choosing-between-the-pgx-and-da...