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

_content/ref/mod: add -x and -diff flags to go mod tidy #304

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion _content/ref/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -2272,7 +2272,7 @@ requirements and to drop unused requirements.
Usage:

```
go mod tidy [-e] [-v] [-go=version] [-compat=version]
go mod tidy [-e] [-v] [-x] [-diff] [-go=version] [-compat=version]
```

`go mod tidy` ensures that the `go.mod` file matches the source code in the
Expand All @@ -2287,6 +2287,12 @@ despite errors encountered while loading packages.
The `-v` flag causes `go mod tidy` to print information about removed modules
to standard error.

The `-x` flag causes `go mod tidy` to print the commands `tidy` executes.

The `-diff` flag causes `go mod tidy` not to modify go.mod or go.sum but
instead print the necessary changes as a unified diff. It exits
with a non-zero code if the diff is not empty.

`go mod tidy` works by loading all of the packages in the [main
module](#glos-main-module), all of its tools, and all of the packages they import,
recursively. This includes packages imported by tests (including tests in other
Expand Down