[go] cmd/go/internal/modload: fix logged filename for 'go mod init -modfile'

0 views
Skip to first unread message

Michael Matloob (Gerrit)

unread,
Apr 9, 2026, 10:51:20 AM (17 hours ago) Apr 9
to Olivier Mengué, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, David Chase, Go LUCI, Michael Matloob, Dmitri Shuralyov, golang-co...@googlegroups.com

Michael Matloob submitted the change

Change information

Commit message:
cmd/go/internal/modload: fix logged filename for 'go mod init -modfile'

Fix 'go mod init -modfile=tools.mod module' which prints
'creating new go.mod' instead of 'creating new tools.mod'.

Note that -modfile already works, but isn't yet documented
and this is the subject of proposal #78503, so this patch is the minimal
patch to make the feature work better with the existing testsuite,
but more test cases will have to be added once the proposal is approved.
Change-Id: Ia4a7c9b6fb71b4365cbe5f3b70a7af6011b9e089
Reviewed-by: David Chase <drc...@google.com>
Reviewed-by: Michael Matloob <mat...@golang.org>
Reviewed-by: Michael Matloob <mat...@google.com>
Files:
  • M src/cmd/go/internal/modload/init.go
Change size: XS
Delta: 1 file changed, 5 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Michael Matloob, +1 by David Chase, +2 by Michael Matloob
  • 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: Ia4a7c9b6fb71b4365cbe5f3b70a7af6011b9e089
Gerrit-Change-Number: 761781
Gerrit-PatchSet: 3
Gerrit-Owner: Olivier Mengué <olivier...@gmail.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
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