The database.Database interface currently defined in the internal package is not necessary and introduces unnecessary complexity. Following Go best practices, we should use concrete implementations directly instead of defining interfaces when they are not required.
According to Go's best practices, interfaces should be defined by the consumer, not the provider. This helps in keeping interfaces minimal and focused.
The database.Database interface is defined in the internal package, making it inaccessible to external modules. This limits its usability and goes against the purpose of having a flexible interface.
Removing the unnecessary interface will simplify the codebase. It will be clearer and more maintainable to use concrete implementations directly.
Directly returning and using concrete implementations aligns with Go's idiomatic practices and avoids the overhead of defining and managing interfaces that are not needed.
Issue summary
The database.Database interface currently defined in the internal package is not necessary and introduces unnecessary complexity. Following Go best practices, we should use concrete implementations directly instead of defining interfaces when they are not required.
According to Go's best practices, interfaces should be defined by the consumer, not the provider. This helps in keeping interfaces minimal and focused.
The database.Database interface is defined in the internal package, making it inaccessible to external modules. This limits its usability and goes against the purpose of having a flexible interface.
Removing the unnecessary interface will simplify the codebase. It will be clearer and more maintainable to use concrete implementations directly.
Directly returning and using concrete implementations aligns with Go's idiomatic practices and avoids the overhead of defining and managing interfaces that are not needed.