Given a project in Golang (1.14+) which is using test dependencies (like github.com/stretchr/testify) and now assume this project is a public library which can be used by others.
Usually when I now use go mod graph
I'll always see this dependency like:
github.com/its-me/[email protected]
github.com/stretchr/[email protected] github.com/davecgh/[email protected]
github.com/stretchr/[email protected] github.com/pmezard/[email protected]
github.com/stretchr/[email protected] github.com/stretchr/[email protected]
github.com/stretchr/[email protected] gopkg.in/[email protected]
gopkg.in/[email protected] gopkg.in/[email protected]
go mod tidy
or go mod download
also seems to download all the test dependencies from the used lib. But instead of telling everybody to use exclude
in their go.mod
files is there a way to even prevent this been exported?
_test.go
to another package run your validations from there. – Hesperiango mod tidy
) at first some testing dependencies what I do not use and I do not want to use. – Bellda