gocqlx
gocqlx copied to clipboard
gocqlxtest: get config from env
PR for the issue #247
With the replacement builtin flags
package to github.com/namsral/flag
we could take config as from flags so from env variables
@Gor027 I don't think such little feature requires additional dependency (tagged as pre
) to entire project. Keeping low subset of dependencies in libraries is a good thing. I'm against merging this.
@zimnx I definitely agree with you, however, as it aims to be used for testing purposes only, perhaps it will not hurt to add it. I am not so familiar with Go, maybe there is a way to add a dependency for tests (or examples, or benchmarks) only, like [dev-dependencies]
in Rust.
Dependencies in Go are per module. Gocqlx consist of single module, so even test dependencies are part of library dependencies. This PR changes go.sum
and go.mod
of main module, so they are going into library dependencies.
It's not worth adding another dependency for all users.
Having said that the Gocqlx core module could add some automation around env vars but it needs to be explicit (well defined function) and not use 3rd party libraries.