gocqlx icon indicating copy to clipboard operation
gocqlx copied to clipboard

gocqlxtest: get config from env

Open Ivan-Feofanov opened this issue 2 years ago • 4 comments

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

Ivan-Feofanov avatar Jan 30 '23 15:01 Ivan-Feofanov

@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 avatar Feb 15 '23 18:02 zimnx

@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.

Gor027 avatar Feb 15 '23 19:02 Gor027

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.

zimnx avatar Feb 15 '23 19:02 zimnx

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.

mmatczuk avatar Feb 16 '23 09:02 mmatczuk