Skip to content

Commit 7546c79

Browse files
dmitshurgopherbot
authored andcommitted
cmd: update vendored golang.org/x/mod
Pull in CL 500335. It teaches modfile.IsDirectoryPath to recognize all relative paths that begin with a "." or ".." path element as a valid directory path (rather than a module path). This allows removing the path == "." check that CL 389298 added to modload.ToDirectoryPath. go get golang.org/x/mod@6e58e47c # CL 500335 go mod tidy go mod vendor Updates #51448. Fixes #60572. Change-Id: Ide99c728c8dac8fd238e13f6d6a0c3917d7aea2d Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/500355 Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
1 parent 0046c14 commit 7546c79

File tree

6 files changed

+32
-16
lines changed

6 files changed

+32
-16
lines changed

src/cmd/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22
55
require (
66
github.com/google/pprof v0.0.0-20230811205829-9131a7e9cc17
77
golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307
8-
golang.org/x/mod v0.13.0
8+
golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6
99
golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36
1010
golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3
1111
golang.org/x/term v0.13.1-0.20231011140651-6a610bc55bff

src/cmd/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab h1:BA4a7pe
44
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
55
golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307 h1:1nIbNxjxQ3+dss3xYMxayoIZONazUTg8/BENwc19sAQ=
66
golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
7-
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
8-
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
7+
golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6 h1:YSyE+/SK6vfYAxf27iVtUZ/tTZOHGN6epnMgE1al/+M=
8+
golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
99
golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36 h1:+lDu3sHZVY5Qqb7ynMbjaT4IsYicvoxypEOIE4aYlYE=
1010
golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
1111
golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3 h1:G9se7UpoI67yWrFY0IIFGf6H3nwLLUZFDBCyOJwWeSc=

src/cmd/go/internal/modload/modfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ var latestVersionIgnoringRetractionsCache par.ErrCache[string, module.Version] /
804804
// an absolute path or a relative path starting with a '.' or '..'
805805
// path component.
806806
func ToDirectoryPath(path string) string {
807-
if path == "." || modfile.IsDirectoryPath(path) {
807+
if modfile.IsDirectoryPath(path) {
808808
return path
809809
}
810810
// The path is not a relative path or an absolute path, so make it relative
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
# Regression test for https://go.dev/issue/51448.
2-
# 'go work init . foo/bar' should produce a go.work file
3-
# with the same paths as 'go work init; go work use -r .'.
2+
# 'go work init . .. foo/bar' should produce a go.work file
3+
# with the same paths as 'go work init; go work use -r ..',
4+
# and it should have 'use .' rather than 'use ./.' inside.
45

5-
go work init . foo/bar
6+
cd dir
7+
8+
go work init . .. foo/bar
69
mv go.work go.work.init
710

811
go work init
9-
go work use -r .
12+
go work use -r ..
1013
cmp go.work go.work.init
1114

15+
cmpenv go.work $WORK/go.work.want
16+
1217
-- go.mod --
1318
module example
1419
go 1.18
15-
-- foo/bar/go.mod --
20+
-- dir/go.mod --
1621
module example
1722
go 1.18
23+
-- dir/foo/bar/go.mod --
24+
module example
25+
go 1.18
26+
-- $WORK/go.work.want --
27+
go $goversion
28+
29+
use (
30+
.
31+
..
32+
./foo/bar
33+
)

src/cmd/vendor/golang.org/x/mod/modfile/rule.go

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

src/cmd/vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ golang.org/x/arch/arm/armasm
2323
golang.org/x/arch/arm64/arm64asm
2424
golang.org/x/arch/ppc64/ppc64asm
2525
golang.org/x/arch/x86/x86asm
26-
# golang.org/x/mod v0.13.0
26+
# golang.org/x/mod v0.13.1-0.20231025225536-6e58e47c7bd6
2727
## explicit; go 1.18
2828
golang.org/x/mod/internal/lazyregexp
2929
golang.org/x/mod/modfile

0 commit comments

Comments
 (0)