Add -mod=mod to 'go run' commands in documentation #2881
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:closes #2880