go mod edit
Edit and format go.mod files
Options
Name | Description |
---|---|
-module | Change the module's path |
-go <version> | Set the expected Go language version |
-require <path> | Add a requirement on the given module |
-droprequire <path> | Drop a requirement on the given module |
-exclude <path> | Add an exclusion on the given module |
-dropexclude <path> | Drop an exclusion on the given module |
-replace <path> | Add a replacement of the given module path and version pair |
-dropreplace <path> | Drops a replacement of the given module path and version pair |
-retract <version> | Add a retraction for the given version |
-dropretract <version> | Drop a retraction for the given version |
-fmt | Format the go.mod file without making other changes |
-print | Print the final go.mod in its text format instead of writing it back to disk |
-json | Print the final go.mod in JSON format instead of writing it back to disk in text forma |