[go] cmd/go: validate inferred module path for go mod init

0 views
Skip to first unread message

Sean Liao (Gerrit)

unread,
Feb 14, 2026, 7:54:28 AMFeb 14
to Yanchen Chen, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Junyang Shao, Michael Matloob, Michael Matloob, Ian Alexander, Michael Pratt, Go LUCI, Jorropo, Gopher Robot, golang-co...@googlegroups.com

Sean Liao submitted the change

Change information

Commit message:
cmd/go: validate inferred module path for go mod init

Ensure `go mod init` validates the module path even when it is inferred from GOPATH.

Fixes #73121
Change-Id: I8b7785ff57eec17bba432f48c8e3a18a2f92aab5
GitHub-Last-Rev: 8ff1ca2d71bee2b948f114ad1f0a4706a4c0b152
GitHub-Pull-Request: golang/go#76432
Reviewed-by: Jorropo <jorro...@gmail.com>
Reviewed-by: Sean Liao <se...@liao.dev>
Reviewed-by: Michael Matloob <mat...@google.com>
Reviewed-by: Junyang Shao <shaoj...@google.com>
Files:
  • M src/cmd/go/internal/modload/init.go
  • M src/cmd/go/testdata/script/mod_init_invalid_major.txt
Change size: M
Delta: 2 files changed, 34 insertions(+), 19 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Michael Matloob, +1 by Junyang Shao, +1 by Jorropo, +2 by Sean Liao
  • 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: I8b7785ff57eec17bba432f48c8e3a18a2f92aab5
Gerrit-Change-Number: 723640
Gerrit-PatchSet: 3
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Ian Alexander <ji...@google.com>
Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Michael Pratt <mpr...@google.com>
Gerrit-CC: Yanchen Chen <yanch...@gmail.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages