Gomod -Online Tutorial| GoTool online toolset

开发工具指南

GoTool provides efficient online gomod tutorials. Help users easily master the use of gomod and improve Go project management efficiency.

使用说明

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.