[go] cmd/go: use fsys.ReadDir for IsStandardPackage

0 views
Skip to first unread message

Michael Matloob (Gerrit)

unread,
Apr 9, 2026, 1:46:14 PM (14 hours ago) Apr 9
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Michael Matloob, Dmitri Shuralyov, Dmitri Shuralyov, Ian Alexander, golang-co...@googlegroups.com

Michael Matloob submitted the change

Change information

Commit message:
cmd/go: use fsys.ReadDir for IsStandardPackage

FIPS140 crypto files will be bound into the virtual filesystem using the
fsys package. So IsStandardPackage needs to use fsys.ReadDir to check
that the fips140 packages are standard packages rather than os.ReadDir
because os.ReadDir doesn't know about the overlay.

It would be nice if we could pass in a io/fs.FS to IsStandardPackage but
the FS paths are slash paths and don't play well with windows paths. So
we pass in ReadDir instead. Maybe in the future we could create an
alternative interface to pass the filesystem through but that's a bigger
project.

Fixes #73649
Change-Id: I576f03cfc52a63cec0598e058e1354676a6a6964
Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
Reviewed-by: Michael Matloob <mat...@google.com>
Auto-Submit: Michael Matloob <mat...@google.com>
Reviewed-by: Dmitri Shuralyov <dmit...@golang.org>
Files:
  • M src/cmd/go/internal/modindex/read.go
  • A src/cmd/go/testdata/mod/example.com_importcrypto_v1.0.0.txt
  • A src/cmd/go/testdata/script/mod_get_fips140_issue73649.txt
  • M src/go/build/build.go
  • M src/internal/goroot/gc.go
Change size: S
Delta: 5 files changed, 35 insertions(+), 6 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Dmitri Shuralyov, +1 by Michael Matloob, +2 by Dmitri Shuralyov
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I576f03cfc52a63cec0598e058e1354676a6a6964
Gerrit-Change-Number: 762581
Gerrit-PatchSet: 6
Gerrit-Owner: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages