There is an important distinction:
- users of your project / library are interested in hard dependencies of it
- developers / testers of your library will actually be using its test
dependencies
Go modules enforces the first group your test dependencies as hard
dependencies, which is not right.
2
To show the exact versions used in your build excluding test-only dependencies,
I think this works:
go list -deps -f '{{with .Module}}{{.Path}} {{.Version}}{{end}}' ./... | sort -u
(Command originally from Bryan Mills).
Regards,
thepudds
--
You received this message because you are subscrib
A dependency is a dependency. There are no scopes like you might find in
Maven(Java) land. Your project needs these "test deps" to run your tests, so
they are in your module file. Even so, Go is smart enough when it builds your
binary to not include the extra bloat.
--
You received this messag
Hi,
Say you have a project with:
- hard dependencies
- some extra dependencies only used during testing, not needed otherwise
Are they treated equally? When you switch to go modules, does the second
group become hard dependencies? It seems like they do.
--
You received this message because you