Skip to content

jrschumacher/go-mod-what

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go mod what

You can see go mod why a package exists in the module graph, and go mod graph shows the module graph, but there is no command to show the module in the version of the package in the module graph.

Install

go install github.com/jrschumacher/go-mod-what@latest

Usage

Usage: go-mod-what [options] <package> [<package> ...]

  -help
        show help
  -modfile string
        path to go.mod file (default "./go.mod")
  -only-version
        only print the version

This will output the module and version of the package golang.org/x/mod v0.21.0 within the go.mod file.

Example:

$ go-mod-what golang.org/x/mod
golang.org/x/mod v0.21.0

Example with multiple packages:

$ go-mod-what golang.org/x/mod golang.org/x/tools
golang.org/x/mod v0.21.0
golang.org/x/tools v0.1.0

Example with a custom go.mod file:

$ go-mod-what -modfile /path/to/go.mod golang.org/x/mod
golang.org/x/mod v0.21.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages