We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 607b664 commit 3f67f80Copy full SHA for 3f67f80
go/packages/gopackages/main.go
@@ -104,6 +104,7 @@ func (app *application) Run(ctx context.Context, args ...string) error {
104
default:
105
return tool.CommandLineErrorf("invalid mode: %s", app.Mode)
106
}
107
+ cfg.Mode |= packages.NeedModule
108
109
lpkgs, err := packages.Load(cfg, args...)
110
if err != nil {
@@ -162,6 +163,9 @@ func (app *application) print(lpkg *packages.Package) {
162
163
kind += "package"
164
165
fmt.Printf("Go %s %q:\n", kind, lpkg.ID) // unique ID
166
+ if mod := lpkg.Module; mod != nil {
167
+ fmt.Printf("\tmodule %s@%s\n", mod.Path, mod.Version)
168
+ }
169
fmt.Printf("\tpackage %s\n", lpkg.Name)
170
171
// characterize type info
0 commit comments