new
| | |
Go Mod Command Set
View Dependency Graph
go mod graph: View the dependency graph of the current module, showing each module and its dependency relationships.- Query the dependency relationship of a specific module:
go mod graph | grep <module_name> - View the dependency tree of the current
module_name:go mod graph | awk '$2 == "<module_name>@version"'
Query Module Information
go list -m all: List the current module and all of its dependency modules.go list -m -versions <module_name>: List all available versions of the specified module.go list -m -u all: Check which modules can be upgraded.
Check Why a Dependency Exists
go mod why -m <module_name>: Check why the current module depends on the specified module.