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

Add -mod=mod to 'go run' commands in documentation #2881

Merged
merged 1 commit into from
Aug 23, 2022
Merged

Conversation

llimllib
Copy link
Contributor

@llimllib llimllib commented Aug 23, 2022

https://go.dev/ref/mod#build-commands is the documentation for the -mod flag.
It seems that basically -mod=mod is never harmful in ent's case, all it does is
tell the go command that it can add ent to the go.mod file if it's not already
present.

I removed the recommendation in the "getting started" guide to run go install,
per @masseelch in #2880, but I did not remove it from the README. I think it
might be a good idea to do so, if the rest of the docs are suggesting users
execute the program via go run -mod=mod? But I'll leave that for another PR.

I updated all the documentation sites, but did not update any blog posts - I can
do so if you think that's a good idea. Here are the remaining usages of "go run"
without the -mod flag:

$ rg -tmd "go run ent"
doc/website/blog/2021-11-1-sync-to-external-data-systems-using-hooks.md
37:go run entgo.io/ent/cmd/ent init User

doc/website/blog/2021-09-02-ent-extension-api.md
55://go:generate go run entc.go

doc/website/blog/2022-05-09-versioned-migrations-sum-file.md
97:go run entgo.io/ent/cmd/ent init User

doc/md/tutorial-todo-gql.md
184://go:generate go run entc.go

examples/entcpkg/README.md
57://go:generate go run entc.go

closes #2880

https://go.dev/ref/mod#build-commands is the documentation for the -mod flag. It seems that basically -mod=mod is never harmful in ent's case, all it does is tell the go command that it can add ent to the go.mod file if it's not already present
Copy link
Member

@a8m a8m left a comment

Choose a reason for hiding this comment

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

💯

Thanks for adding this @llimllib

@a8m a8m merged commit f3b6dd9 into ent:master Aug 23, 2022
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 this pull request may close these issues.

The "Getting Started" instructions don't work
2 participants