Skip to content

Commit fb23428

Browse files
committed
[release-branch.go1.22] all: merge master (0324250) into release-branch.go1.22
Merge List: + 2023-12-19 0324250 doc: comment out remaining TODOs in Go 1.22 relnotes (for now) + 2023-12-19 9dd1cde doc/go1.22,cmd/go: document that 'go mod init' no longer imports from other vendoring tools + 2023-12-19 22284c3 doc/go1.22: document removal of 'go get' support in GOPATH mode + 2023-12-19 339177a doc: typo fix for net/http.ServeMux + 2023-12-19 52dbffe cmd/go/internal/toolchain: revert "make a best effort to parse 'go run' and 'go install' flags" Change-Id: I102e8267373364d0ad6170d36442d19048268765
2 parents f06eaf0 + 0324250 commit fb23428

File tree

13 files changed

+93
-144
lines changed

13 files changed

+93
-144
lines changed

doc/go1.22.html

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,20 @@ <h3 id="go-command">Go command</h3>
8383
but not both.
8484
</p>
8585

86-
<!-- CL 518775 -->
86+
<!-- CL 518775, https://go.dev/issue/60915 -->
8787
<p>
88-
<!-- cmd/go: delete GOPATH-mode get -->
89-
</p>
90-
91-
<!-- https://go.dev/issue/60915 -->
92-
<p>
93-
<!-- preserve basic GOPATH mode indefinitely -->
88+
<code>go</code> <code>get</code> is no longer supported outside of a module in the
89+
legacy <code>GOPATH</code> mode (that is, with <code>GO111MODULE=off</code>).
90+
Other build commands, such as <code>go</code> <code>build</code> and
91+
<code>go</code> <code>test</code>, will continue to work indefinitely
92+
for legacy <code>GOPATH</code> programs.
9493
</p>
9594

9695
<!-- CL 518776 -->
9796
<p>
98-
<!-- cmd/go: remove conversion of legacy pre-module dependency configs -->
97+
<code>go</code> <code>mod</code> <code>init</code> no longer attempts to import
98+
module requirements from configuration files for other vendoring tools
99+
(such as <code>Gopkg.lock</code>).
99100
</p>
100101

101102
<!-- CL 495447 -->
@@ -135,9 +136,9 @@ <h3 id="trace">Trace</h3>
135136

136137
<h3 id="vet">Vet</h3>
137138

138-
<p><!-- CL 539016 -->
139-
TODO: <a href="https://go.dev/cl/539016">https://go.dev/cl/539016</a>: go/analysis/passes/loopclosure: disable checker after go1.22.; loopclosure was modified to only not report in files with GoVersion after 1.22.
140-
</p>
139+
<!-- <p><\!-- CL 539016 -\-> -->
140+
<!-- TODO: <a href="https://go.dev/cl/539016">https://go.dev/cl/539016</a>: go/analysis/passes/loopclosure: disable checker after go1.22.; loopclosure was modified to only not report in files with GoVersion after 1.22. -->
141+
<!-- </p> -->
141142

142143
<h4 id="vet-appends">New warnings for missing values after append</h4>
143144

@@ -359,7 +360,7 @@ <h3 id="math_rand_v2">New math/rand/v2 package</h3>
359360
We plan to include an API migration tool in a future release, likely Go 1.23.
360361
</p>
361362

362-
<h3 id="enhanced_routing_patterns"</h3>
363+
<h3 id="enhanced_routing_patterns">Enhanced routing patterns</h3>
363364

364365
<p><!-- https://go.dev/issue/61410 -->
365366
HTTP routing in the standard library is now more expressive.
@@ -407,9 +408,9 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
407408
There are also various performance improvements, not enumerated here.
408409
</p>
409410

410-
<p>
411-
TODO: complete this section
412-
</p>
411+
<!-- <p> -->
412+
<!-- TODO: complete this section -->
413+
<!-- </p> -->
413414

414415
<dl id="archive/tar"><dt><a href="/pkg/archive/tar/">archive/tar</a></dt>
415416
<dd>
@@ -649,17 +650,17 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
649650
</dd>
650651
</dl><!-- go/version -->
651652

652-
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
653-
<dd>
654-
<p><!-- https://go.dev/issue/61619 -->
655-
TODO: <a href="https://go.dev/issue/61619">https://go.dev/issue/61619</a>: allow actions in JS template literals
656-
</p>
653+
<!-- <dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt> -->
654+
<!-- <dd> -->
655+
<!-- <p><\!-- https://go.dev/issue/61619 -\-> -->
656+
<!-- TODO: <a href="https://go.dev/issue/61619">https://go.dev/issue/61619</a>: allow actions in JS template literals -->
657+
<!-- </p> -->
657658

658-
<p><!-- CL 507995 -->
659-
TODO: <a href="https://go.dev/cl/507995">https://go.dev/cl/507995</a>: html/template: support parsing complex JS template literals; modified api/next/61619.txt
660-
</p>
661-
</dd>
662-
</dl><!-- html/template -->
659+
<!-- <p><\!-- CL 507995 -\-> -->
660+
<!-- TODO: <a href="https://go.dev/cl/507995">https://go.dev/cl/507995</a>: html/template: support parsing complex JS template literals; modified api/next/61619.txt -->
661+
<!-- </p> -->
662+
<!-- </dd> -->
663+
<!-- </dl><\!-- html/template -\-> -->
663664

664665
<dl id="io"><dt><a href="/pkg/io/">io</a></dt>
665666
<dd>
@@ -727,31 +728,31 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
727728
<a href="/doc/godebug"><code>GODEBUG</code></a> field <code>httplaxcontentlength=1</code>.
728729
</p>
729730

730-
<p><!-- CL 528355 -->
731-
TODO: <a href="https://go.dev/cl/528355">https://go.dev/cl/528355</a>: net/http: implement path value methods on Request; modified api/next/61410.txt
732-
</p>
731+
<!-- <p><\!-- CL 528355 -\-> -->
732+
<!-- TODO: <a href="https://go.dev/cl/528355">https://go.dev/cl/528355</a>: net/http: implement path value methods on Request; modified api/next/61410.txt -->
733+
<!-- </p> -->
733734
</dd>
734735
</dl><!-- net/http -->
735736

736-
<dl id="net/http/cgi"><dt><a href="/pkg/net/http/cgi/">net/http/cgi</a></dt>
737-
<dd>
738-
<p><!-- CL 539615 -->
739-
TODO: <a href="https://go.dev/cl/539615">https://go.dev/cl/539615</a>: net/http/cgi: the PATH_INFO should be empty or start with a slash
740-
</p>
741-
</dd>
742-
</dl><!-- net/http/cgi -->
743-
744-
<dl id="net/netip"><dt><a href="/pkg/net/netip/">net/netip</a></dt>
745-
<dd>
746-
<p><!-- https://go.dev/issue/61642 -->
747-
TODO: <a href="https://go.dev/issue/61642">https://go.dev/issue/61642</a>: add Prefix.Compare and AddrPort.Compare
748-
</p>
749-
750-
<p><!-- CL 524616 -->
751-
TODO: <a href="https://go.dev/cl/524616">https://go.dev/cl/524616</a>: net/netip: add AddrPort.Compare and Prefix.Compare; modified api/next/61642.txt
752-
</p>
753-
</dd>
754-
</dl><!-- net/netip -->
737+
<!-- <dl id="net/http/cgi"><dt><a href="/pkg/net/http/cgi/">net/http/cgi</a></dt> -->
738+
<!-- <dd> -->
739+
<!-- <p><\!-- CL 539615 -\-> -->
740+
<!-- TODO: <a href="https://go.dev/cl/539615">https://go.dev/cl/539615</a>: net/http/cgi: the PATH_INFO should be empty or start with a slash -->
741+
<!-- </p> -->
742+
<!-- </dd> -->
743+
<!-- </dl><\!-- net/http/cgi -\-> -->
744+
745+
<!-- <dl id="net/netip"><dt><a href="/pkg/net/netip/">net/netip</a></dt> -->
746+
<!-- <dd> -->
747+
<!-- <p><\!-- https://go.dev/issue/61642 -\-> -->
748+
<!-- TODO: <a href="https://go.dev/issue/61642">https://go.dev/issue/61642</a>: add Prefix.Compare and AddrPort.Compare -->
749+
<!-- </p> -->
750+
751+
<!-- <p><\!-- CL 524616 -\-> -->
752+
<!-- TODO: <a href="https://go.dev/cl/524616">https://go.dev/cl/524616</a>: net/netip: add AddrPort.Compare and Prefix.Compare; modified api/next/61642.txt -->
753+
<!-- </p> -->
754+
<!-- </dd> -->
755+
<!-- </dl><\!-- net/netip -\-> -->
755756

756757
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
757758
<dd>

src/cmd/go/alldocs.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/base/goflags.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type boolFlag interface {
8888
}
8989

9090
// SetFromGOFLAGS sets the flags in the given flag set using settings in $GOFLAGS.
91-
func SetFromGOFLAGS(flags *flag.FlagSet, ignoreErrors bool) {
91+
func SetFromGOFLAGS(flags *flag.FlagSet) {
9292
InitGOFLAGS()
9393

9494
// This loop is similar to flag.Parse except that it ignores
@@ -121,22 +121,22 @@ func SetFromGOFLAGS(flags *flag.FlagSet, ignoreErrors bool) {
121121

122122
if fb, ok := f.Value.(boolFlag); ok && fb.IsBoolFlag() {
123123
if hasValue {
124-
if err := flags.Set(f.Name, value); err != nil && !ignoreErrors {
124+
if err := flags.Set(f.Name, value); err != nil {
125125
fmt.Fprintf(flags.Output(), "go: invalid boolean value %q for flag %s (from %s): %v\n", value, name, where, err)
126126
flags.Usage()
127127
}
128128
} else {
129-
if err := flags.Set(f.Name, "true"); err != nil && !ignoreErrors {
129+
if err := flags.Set(f.Name, "true"); err != nil {
130130
fmt.Fprintf(flags.Output(), "go: invalid boolean flag %s (from %s): %v\n", name, where, err)
131131
flags.Usage()
132132
}
133133
}
134134
} else {
135-
if !hasValue && !ignoreErrors {
135+
if !hasValue {
136136
fmt.Fprintf(flags.Output(), "go: flag needs an argument: %s (from %s)\n", name, where)
137137
flags.Usage()
138138
}
139-
if err := flags.Set(f.Name, value); err != nil && !ignoreErrors {
139+
if err := flags.Set(f.Name, value); err != nil {
140140
fmt.Fprintf(flags.Output(), "go: invalid value %q for flag %s (from %s): %v\n", value, name, where, err)
141141
flags.Usage()
142142
}

src/cmd/go/internal/modcmd/init.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ module path argument is omitted, init will attempt to infer the module path
2525
using import comments in .go files, vendoring tool configuration files (like
2626
Gopkg.lock), and the current directory (if in GOPATH).
2727
28-
If a configuration file for a vendoring tool is present, init will attempt to
29-
import module requirements from it.
30-
3128
See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.
3229
`,
3330
Run: runInit,

src/cmd/go/internal/modfetch/fetch.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ func readGoSum(dst map[module.Version][]string, file string, data []byte) {
525525
// ignore malformed line so that go mod tidy can fix go.sum
526526
continue
527527
} else {
528-
base.Fatalf("go: malformed go.sum:\n%s:%d: wrong number of fields %v\n", file, lineno, len(f))
528+
base.Fatalf("malformed go.sum:\n%s:%d: wrong number of fields %v\n", file, lineno, len(f))
529529
}
530530
}
531531
if f[2] == emptyGoModHash {
@@ -574,32 +574,32 @@ func checkMod(ctx context.Context, mod module.Version) {
574574
// Do the file I/O before acquiring the go.sum lock.
575575
ziphash, err := CachePath(ctx, mod, "ziphash")
576576
if err != nil {
577-
base.Fatalf("go: verifying %v", module.VersionError(mod, err))
577+
base.Fatalf("verifying %v", module.VersionError(mod, err))
578578
}
579579
data, err := lockedfile.Read(ziphash)
580580
if err != nil {
581-
base.Fatalf("go: verifying %v", module.VersionError(mod, err))
581+
base.Fatalf("verifying %v", module.VersionError(mod, err))
582582
}
583583
data = bytes.TrimSpace(data)
584584
if !isValidSum(data) {
585585
// Recreate ziphash file from zip file and use that to check the mod sum.
586586
zip, err := CachePath(ctx, mod, "zip")
587587
if err != nil {
588-
base.Fatalf("go: verifying %v", module.VersionError(mod, err))
588+
base.Fatalf("verifying %v", module.VersionError(mod, err))
589589
}
590590
err = hashZip(mod, zip, ziphash)
591591
if err != nil {
592-
base.Fatalf("go: verifying %v", module.VersionError(mod, err))
592+
base.Fatalf("verifying %v", module.VersionError(mod, err))
593593
}
594594
return
595595
}
596596
h := string(data)
597597
if !strings.HasPrefix(h, "h1:") {
598-
base.Fatalf("go: verifying %v", module.VersionError(mod, fmt.Errorf("unexpected ziphash: %q", h)))
598+
base.Fatalf("verifying %v", module.VersionError(mod, fmt.Errorf("unexpected ziphash: %q", h)))
599599
}
600600

601601
if err := checkModSum(mod, h); err != nil {
602-
base.Fatal(err)
602+
base.Fatalf("%s", err)
603603
}
604604
}
605605

@@ -684,7 +684,7 @@ func haveModSumLocked(mod module.Version, h string) bool {
684684
return true
685685
}
686686
if strings.HasPrefix(vh, "h1:") {
687-
base.Fatalf("go: verifying %s@%s: checksum mismatch\n\tdownloaded: %v\n\t%s: %v"+goSumMismatch, mod.Path, mod.Version, h, sumFileName, vh)
687+
base.Fatalf("verifying %s@%s: checksum mismatch\n\tdownloaded: %v\n\t%s: %v"+goSumMismatch, mod.Path, mod.Version, h, sumFileName, vh)
688688
}
689689
}
690690
// Also check workspace sums.
@@ -696,7 +696,7 @@ func haveModSumLocked(mod module.Version, h string) bool {
696696
if h == vh {
697697
foundMatch = true
698698
} else if strings.HasPrefix(vh, "h1:") {
699-
base.Fatalf("go: verifying %s@%s: checksum mismatch\n\tdownloaded: %v\n\t%s: %v"+goSumMismatch, mod.Path, mod.Version, h, goSumFile, vh)
699+
base.Fatalf("verifying %s@%s: checksum mismatch\n\tdownloaded: %v\n\t%s: %v"+goSumMismatch, mod.Path, mod.Version, h, goSumFile, vh)
700700
}
701701
}
702702
}
@@ -895,7 +895,7 @@ func TrimGoSum(keep map[module.Version]bool) {
895895
defer goSum.mu.Unlock()
896896
inited, err := initGoSum()
897897
if err != nil {
898-
base.Fatal(err)
898+
base.Fatalf("%s", err)
899899
}
900900
if !inited {
901901
return

src/cmd/go/internal/test/testflag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (f *shuffleFlag) Set(value string) error {
222222
// go test fmt -custom-flag-for-fmt-test
223223
// go test -x math
224224
func testFlags(args []string) (packageNames, passToTest []string) {
225-
base.SetFromGOFLAGS(&CmdTest.Flag, false)
225+
base.SetFromGOFLAGS(&CmdTest.Flag)
226226
addFromGOFLAGS := map[string]bool{}
227227
CmdTest.Flag.Visit(func(f *flag.Flag) {
228228
if short := strings.TrimPrefix(f.Name, "test."); passFlagToTest[short] {

src/cmd/go/internal/toolchain/exec.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ func execGoToolchain(gotoolchain, dir, exe string) {
4444
if e.ProcessState.Exited() {
4545
os.Exit(e.ProcessState.ExitCode())
4646
}
47-
base.Fatalf("go: exec %s: %s", gotoolchain, e.ProcessState)
47+
base.Fatalf("exec %s: %s", gotoolchain, e.ProcessState)
4848
}
49-
base.Fatalf("go: exec %s: %s", exe, err)
49+
base.Fatalf("exec %s: %s", exe, err)
5050
}
5151
os.Exit(0)
5252
}
5353
err := syscall.Exec(exe, os.Args, os.Environ())
54-
base.Fatalf("go: exec %s: %v", gotoolchain, err)
54+
base.Fatalf("exec %s: %v", gotoolchain, err)
5555
}

0 commit comments

Comments
 (0)