...
1# 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 ..',
4# and it should have 'use .' rather than 'use ./.' inside.
5
6cd dir
7
8go work init . .. foo/bar
9mv go.work go.work.init
10
11go work init
12go work use -r ..
13cmp go.work go.work.init
14
15cmpenv go.work $WORK/go.work.want
16
17-- go.mod --
18module example
19go 1.18
20-- dir/go.mod --
21module example
22go 1.18
23-- dir/foo/bar/go.mod --
24module example
25go 1.18
26-- $WORK/go.work.want --
27go $goversion
28
29use (
30 .
31 ..
32 ./foo/bar
33)
View as plain text