Skip to content
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

Define a separate Go module for the testify migration tool #266

Open
dolmen opened this issue Jun 12, 2023 · 1 comment · May be fixed by #268
Open

Define a separate Go module for the testify migration tool #266

dolmen opened this issue Jun 12, 2023 · 1 comment · May be fixed by #268

Comments

@dolmen
Copy link
Contributor

dolmen commented Jun 12, 2023

gty-migrate-from-testify brings its own dependencies which are not used in general for users of gotest.tools/v3/assert.

By defining a new Go module for gty-migrate-from-testify, the dependency problem will be contained. golang.org/x/tools will disapear from the root go.mod.

How to do it:

cd assert/cmd/gty-migrate-from-testify
go mod init gotest.tools/assert/cmd/gty-migrate-from-testify
go mod tidy
git add go.mod go.sum
sed -i= 's!gotest.tools/v3/assert/cmd/gty-migrate-from-testify!gotest.tools/assert/cmd/gty-migrate-from-testify/v1!' doc.go
git add doc.go 
cd ../..
go mod tidy # Cleanup dependencies which were used only by gty-migrate-from-testify
git add go.mod go.sum
sed -i= 's!gotest.tools/v3/assert/cmd/gty-migrate-from-testify!gotest.tools/assert/cmd/gty-migrate-from-testify/v1!' assert/assert.go
git add assert/assert.go
git commit -m "assert/cmd/gty-migrate-from-testify: define Go module"
git tag -a assert/cmd/gty-migrate-from-testify/v1.0.0
git push --tags
@dnephin
Copy link
Member

dnephin commented Jun 13, 2023

Sounds good! When this tool was first written modules didn't exist, but now I think it's a good idea to make it a separate module.

I think at the same time it would be good to change the import path. I've noticed there are often problems when a package exist in different modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants