Home  >  Article  >  Backend Development  >  How Do I Get a List of Installed Go Packages?

How Do I Get a List of Installed Go Packages?

Patricia Arquette
Patricia ArquetteOriginal
2024-10-30 09:26:03858browse

How Do I Get a List of Installed Go Packages?

Determining Installed Package Listings in Go

Retrieving a comprehensive list of installed Go packages is crucial for various scenarios, such as reinstalling packages on a different machine. This article addresses the question of listing installed packages using goinstall, an outdated approach no longer applicable to current Go installations.

Updated Method for Go Versions 1.0 and Above

To obtain a complete list of installed Go packages, utilize the following command:

go list ...

The three literal periods "..." represent a wildcard that matches all packages on the system.

Example Output:

github.com/fvbommel/sortorder
github.com/go-delve/delve
github.com/golang/glog
github.com/google/pprof
github.com/ianlancetaylor/demangle
github.com/mattn/go-sqlite3
github.com/michielheld/godocrunner
github.com/rogpeppe/godef
github.com/rogpeppe/goinstall
github.com/uber-go/zap

Additional Command Options

The go list command offers extensive options. Refer to go list -h for further details.

Alternative Resources

For further insights into the versatility of the go list command, consult Dave Cheney's blog article: [go list, Your Swiss Army Knife](https://dave.cheney.net/2015/09/01/go-list-your-swiss-army-knife).

The above is the detailed content of How Do I Get a List of Installed Go Packages?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn