deps: fix dependency cycle with testify (#124)#140
Merged
hanzei merged 1 commit intostretchr:masterfrom Aug 8, 2023
Merged
Conversation
In go.mod exclude the previous of testify to break the dependency cycle. Fixes stretchr#124 and stretchr/testify#1292 (once testify upgrades). go mod edit -exclude=github.com/stretchr/testify@v1.8.0 go mod tidy
kaovilai
approved these changes
Jul 10, 2023
hanzei
approved these changes
Aug 8, 2023
Collaborator
hanzei
left a comment
There was a problem hiding this comment.
Makes sense, thanks for the fix 👍
Contributor
Author
|
Thanks for the merge and the release. As I am now a co-maintainer of testify I'll quickly propose the fix for testify side. |
dolmen
added a commit
to stretchr/testify
that referenced
this pull request
Aug 9, 2023
See stretchr/objx#140 go get github.com/stretchr/objx@v0.5.1
dolmen
added a commit
to stretchr/testify
that referenced
this pull request
Mar 5, 2024
$ go mod edit -dropexclude=github.com/stretchr/testify@v1.8.0 -exclude=github.com/stretchr/testify@v1.8.4 $ go mod tidy See stretchr/objx#140
dolmen
added a commit
to stretchr/testify
that referenced
this pull request
May 25, 2025
$ go mod edit -dropexclude=github.com/stretchr/testify@v1.8.0 -exclude=github.com/stretchr/testify@v1.8.4 $ go mod tidy See stretchr/objx#140
|
Another solution could have been to move the tests in a sub packages and add a go.mod file in it. This way the main go.mod won't use testify and then you would have no cycle dependency. Is there a problem with this idea? |
dolmen
added a commit
to stretchr/testify
that referenced
this pull request
Jun 1, 2025
$ go mod edit -dropexclude=github.com/stretchr/testify@v1.8.0 -exclude=github.com/stretchr/testify@v1.8.4 $ go mod tidy See stretchr/objx#140
vyas-git
pushed a commit
to vyas-git/testify
that referenced
this pull request
Jun 24, 2025
$ go mod edit -dropexclude=github.com/stretchr/testify@v1.8.0 -exclude=github.com/stretchr/testify@v1.8.4 $ go mod tidy See stretchr/objx#140
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In go.mod exclude the previous of testify to break the dependency cycle. Fixes #124 and stretchr/testify#1292 (once testify upgrades).
Checklist
task testtask lint(well, see gofmt 1.20 #139)