Skip to content

deps: fix dependency cycle with testify (#124) #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dolmen
Copy link
Contributor

@dolmen dolmen commented Jul 4, 2023

Summary

In go.mod exclude the previous of testify to break the dependency cycle. Fixes #124 and stretchr/testify#1292 (once testify upgrades).

$ go mod edit -exclude=github.com/stretchr/[email protected]
$ go mod tidy

Checklist

  • Tests are passing: task test
  • Code style is correct: task lint (well, see gofmt 1.20 #139)

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/[email protected]
  go mod tidy
Copy link
Collaborator

@hanzei hanzei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks for the fix 👍

@hanzei hanzei added this to the v1.0.0 milestone Aug 8, 2023
@hanzei hanzei merged commit 65e87f4 into stretchr:master Aug 8, 2023
@dolmen
Copy link
Contributor Author

dolmen commented Aug 9, 2023

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
dolmen added a commit to stretchr/testify that referenced this pull request Mar 5, 2024
$ go mod edit -dropexclude=github.com/stretchr/[email protected] -exclude=github.com/stretchr/[email protected]
$ 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/[email protected] -exclude=github.com/stretchr/[email protected]
$ go mod tidy

See stretchr/objx#140
@ccoVeille
Copy link

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?

@ccoVeille
Copy link

dolmen added a commit to stretchr/testify that referenced this pull request Jun 1, 2025
$ go mod edit -dropexclude=github.com/stretchr/[email protected] -exclude=github.com/stretchr/[email protected]
$ 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/[email protected] -exclude=github.com/stretchr/[email protected]
$ go mod tidy

See stretchr/objx#140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circular dependency with testify
4 participants