Skip to content

Commit cd75735

Browse files
committed
go/analysis: expose GoMod to Pass.Module
go.mod (w/ go.sum in the same dir) is needed by https://github.com/AkihiroSuda/gosocialcheck to check the reputation of dependencies. Fixes golang/go#73878 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 1c017f1 commit cd75735

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

go/analysis/analysis.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,5 +252,6 @@ type Fact interface {
252252
type Module struct {
253253
Path string // module path
254254
Version string // module version ("" if unknown, such as for workspace modules)
255+
GoMod string // path to go.mod file used when loading this module, if any
255256
GoVersion string // go version used in module (e.g. "go1.22.0")
256257
}

go/analysis/checker/checker.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ func (act *Action) execOnce() {
321321
if mod := act.Package.Module; mod != nil {
322322
module.Path = mod.Path
323323
module.Version = mod.Version
324+
module.GoMod = mod.GoMod
324325
module.GoVersion = mod.GoVersion
325326
}
326327

0 commit comments

Comments
 (0)