Skip to content

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/testify@v1.8.0
$ 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/testify@v1.8.0
  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
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
@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/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
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