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

testdata: don't let tests rely on rewriting mod files #183

Merged
merged 1 commit into from
Nov 8, 2020
Merged

testdata: don't let tests rely on rewriting mod files #183

merged 1 commit into from
Nov 8, 2020

Conversation

mvdan
Copy link
Member

@mvdan mvdan commented Nov 7, 2020

In Go 1.15, if a dependency is required but not listed in go.mod/go.sum,
it's resolved and added automatically.

This is changing in 1.16. From that release, one will have to explicitly
update the mod files via 'go mod tidy' or 'go get'.

To get ahead of the curve, start using -mod=readonly to get the same
behavior in 1.15, and fix all existing tests.

The only tests that failed were imports.txt and syntax.txt, the only
ones to require other modules. But since we're here, let's add the 'go'
line to all go.mod files as well.

In Go 1.15, if a dependency is required but not listed in go.mod/go.sum,
it's resolved and added automatically.

This is changing in 1.16. From that release, one will have to explicitly
update the mod files via 'go mod tidy' or 'go get'.

To get ahead of the curve, start using -mod=readonly to get the same
behavior in 1.15, and fix all existing tests.

The only tests that failed were imports.txt and syntax.txt, the only
ones to require other modules. But since we're here, let's add the 'go'
line to all go.mod files as well.
@mvdan mvdan requested review from lu4p, capnspacehook and pagran and removed request for lu4p and capnspacehook November 7, 2020 20:51
Copy link
Contributor

@capnspacehook capnspacehook left a comment

Choose a reason for hiding this comment

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

Looks good, didn't know that you will have to manually update the go.mod file... Why'd they make that change?

@mvdan
Copy link
Member Author

mvdan commented Nov 8, 2020

See golang/go#40728 :)

@mvdan mvdan merged commit 39372a8 into burrowers:master Nov 8, 2020
@mvdan mvdan deleted the tests-mod-redonly branch November 8, 2020 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants