Open Blank-Xu opened 4 years ago
Indeed... We also looked at why so many dependencies are being included into our project, when we use the pure ( none CGO ) Go version of sqlite ( https://gitlab.com/cznic/sqlite ). Only to see that its all coming from sqlx.
There isn't really any good solution for this; removing them means they will get re-added on go test
, and you do want some versioning for test dependencies too. Modules also don't really have an option to list "test dependencies".
I'm wondering if the go.work file would be the way to go here. There could be the main library in one path, then all the tests in a separate path with its own go.mod file.
Users can use sqlx with any database driver. However, the tests force them to install unnecessary MySQL, PostgreSQL or SQLite drivers, and the mattn/go-sqlite3
cause users have to enable CGO.
Would you mind to remove these packages from go.mod and go.sum?
github.com/go-sql-driver/mysql v1.4.0
github.com/lib/pq v1.0.0
github.com/mattn/go-sqlite3 v1.9.0
These three packages just used in test files and does not necessary to include in sqlx package.