Go list: Difference between revisions
Jump to navigation
Jump to search
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[Go_Tool|go tool]] | * [[Go_Tool#list|go tool]] | ||
* [[Go_test_Command#Package_List_Mode|<tt>go test</tt> | Package List Mode]] | * [[Go_test_Command#Package_List_Mode|<tt>go test</tt> | Package List Mode]] | ||
=Overview= | =Overview= | ||
The <code>list</code> command lists all installed packages. If the "./..." argument is give, the <code>list</code> displays the local packages, one per line. | |||
The command can also be used to discover new versions of the dependencies. | |||
This command list all of the modules that are dependencies of the current module, along with the latest version available for each: | |||
<syntaxhighlight lang='bash'> | |||
go list -m -u all | |||
</syntaxhighlight> | |||
To list the latest version available for a specific module: | |||
<syntaxhighlight lang='bash'> | |||
go list -m -u example.com/somemodule | |||
</syntaxhighlight> | |||
The shared flags described here apply: {{Internal|Go_Tool_Shared_Flags#Overview|Shared Flags}} | |||
=Options= | |||
==<tt>-m</tt>== | |||
The -m flag causes list to list modules instead of packages. | |||
==<tt>-u</tt>== | |||
Add information about available upgrades. |
Latest revision as of 23:13, 12 March 2024
Internal
Overview
The list
command lists all installed packages. If the "./..." argument is give, the list
displays the local packages, one per line.
The command can also be used to discover new versions of the dependencies.
This command list all of the modules that are dependencies of the current module, along with the latest version available for each:
go list -m -u all
To list the latest version available for a specific module:
go list -m -u example.com/somemodule
The shared flags described here apply:
Options
-m
The -m flag causes list to list modules instead of packages.
-u
Add information about available upgrades.