• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“go list” Command Examples

by admin

The “go list” command in Go is used to obtain information about packages or modules in your project. It provides various options to customize the output and retrieve specific details.

To list packages in your project, you can use the command “go list ./…”. This will display all packages in the current directory and its subdirectories.

To list only standard packages, you can use “go list std”. This will show the standard packages that come bundled with Go.

You can also specify specific packages to list by providing their import paths. For example, “go list -json time net/http” will list the packages “time” and “net/http” in JSON format.

Furthermore, the “-m” option can be used to list module-related information. For example, “go list -m -u all” will display the module dependencies and available updates for all modules in your project.

The “go list” command provides a comprehensive way to gather information about packages and modules. It is useful for inspecting package import paths, dependencies, and other package-related details.

“go list” Command Examples

1. List packages:

# go list ./...

2. List standard packages:

# go list std

3. List packages in JSON format:

# go list -json time net/http

4. List module dependencies and available updates:

# go list -m -u all

Summary

The “go list” command in Go is used to obtain information about packages or modules in your project. It can list packages in the current directory and its subdirectories, standard packages, or specific packages specified by import paths. It can also provide information in JSON format and retrieve module dependencies and available updates. “go list” is a handy tool for inspecting package details and module-related information.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to view linux disk partitions (partition table)
  2. “az login” Command Examples (Log in to Azure)
  3. Basic vi commands (cheat sheet)
  4. aurman Command Examples
  5. i3status: command not found
  6. Unable to set a GRUB password on a Raspberry Pi 3 system
  7. detox: Renames files to make them easier to work with
  8. How does “chmod -R 755” works
  9. cockpit-ws Command Examples in Linux
  10. lumen Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright