Skip to content

Commit e884e0e

Browse files
committed
all: merge master (92d58ea) into gopls-release-branch.0.9
Also add a replace directive to gopls/go.mod, and re-tidy. Merge List: + 2022-08-08 92d58ea internal/lsp/cache: register a file watcher for explicit GOWORK values + 2022-08-08 98aef77 internal/lsp/cache: track explicit go.work files outside the workspace + 2022-08-08 fff6d6d internal/lsp: update the broken workspace message to mention go.work + 2022-08-08 9b60852 gopls/internal/regtest: move TestMultipleModules_Warning to ./workspace + 2022-08-05 06d96ee gopls/internal/regtest/bench: add a test for completion following edits Change-Id: I78f2b3552725d0317ec1dd62196558997f70fe29
2 parents a6f5f46 + 92d58ea commit e884e0e

File tree

23 files changed

+535
-247
lines changed

23 files changed

+535
-247
lines changed

gopls/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ require (
2323
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
2424
golang.org/x/text v0.3.7 // indirect
2525
)
26+
27+
replace golang.org/x/tools => ../

gopls/go.sum

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,20 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX
4141
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
4242
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
4343
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
44-
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
45-
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
4644
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
47-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
48-
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
49-
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
5045
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
5146
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
5247
golang.org/x/exp/typeparams v0.0.0-20220722155223-a9213eeb770e h1:7Xs2YCOpMlNqSQSmrrnhlzBXIE/bpMecZplbLePTJvE=
5348
golang.org/x/exp/typeparams v0.0.0-20220722155223-a9213eeb770e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
54-
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
55-
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
5649
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
5750
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
5851
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
59-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
60-
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
61-
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
6252
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
63-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
6453
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
65-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
66-
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
6754
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
6855
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
6956
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
70-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
71-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
72-
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7357
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
74-
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
75-
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7658
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
7759
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
7860
golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -82,23 +64,11 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9w
8264
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8365
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
8466
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
85-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
8667
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
87-
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
8868
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
8969
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
90-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
91-
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
92-
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
93-
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
94-
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
95-
golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
96-
golang.org/x/tools v0.1.11-0.20220523181440-ccb10502d1a5/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
97-
golang.org/x/tools v0.1.13-0.20220805154628-fad228792ce9 h1:wnZ6J3Vs1RS/EjUI71D435/4VhO7j/XKzGYkQy4Rfp0=
98-
golang.org/x/tools v0.1.13-0.20220805154628-fad228792ce9/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
9970
golang.org/x/vuln v0.0.0-20220725105440-4151a5aca1df h1:BkeW9/QJhcigekDUPS9N9bIb0v7gPKKmLYeczVAqr2s=
10071
golang.org/x/vuln v0.0.0-20220725105440-4151a5aca1df/go.mod h1:UZshlUPxXeGUM9I14UOawXQg6yosDE9cr1vKY/DzgWo=
101-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
10272
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
10373
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
10474
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

gopls/internal/regtest/bench/bench_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func benchmarkEnv(tb testing.TB) *Env {
133133
dir := benchmarkDir()
134134

135135
var err error
136-
sandbox, editor, awaiter, err = connectEditor(dir)
136+
sandbox, editor, awaiter, err = connectEditor(dir, fake.EditorConfig{})
137137
if err != nil {
138138
log.Fatalf("connecting editor: %v", err)
139139
}
@@ -154,7 +154,7 @@ func benchmarkEnv(tb testing.TB) *Env {
154154

155155
// connectEditor connects a fake editor session in the given dir, using the
156156
// given editor config.
157-
func connectEditor(dir string) (*fake.Sandbox, *fake.Editor, *regtest.Awaiter, error) {
157+
func connectEditor(dir string, config fake.EditorConfig) (*fake.Sandbox, *fake.Editor, *regtest.Awaiter, error) {
158158
s, err := fake.NewSandbox(&fake.SandboxConfig{
159159
Workdir: dir,
160160
GOPROXY: "https://proxy.golang.org",
@@ -165,7 +165,7 @@ func connectEditor(dir string) (*fake.Sandbox, *fake.Editor, *regtest.Awaiter, e
165165

166166
a := regtest.NewAwaiter(s.Workdir)
167167
ts := getServer()
168-
e, err := fake.NewEditor(s, fake.EditorConfig{}).Connect(context.Background(), ts, a.Hooks())
168+
e, err := fake.NewEditor(s, config).Connect(context.Background(), ts, a.Hooks())
169169
if err != nil {
170170
return nil, nil, nil, err
171171
}

gopls/internal/regtest/bench/completion_test.go

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,21 @@ import (
1818
type completionBenchOptions struct {
1919
file, locationRegexp string
2020

21-
// hook to run edits before initial completion
22-
preCompletionEdits func(*Env)
21+
// Hooks to run edits before initial completion
22+
setup func(*Env) // run before the benchmark starts
23+
beforeCompletion func(*Env) // run before each completion
2324
}
2425

2526
func benchmarkCompletion(options completionBenchOptions, b *testing.B) {
2627
dir := benchmarkDir()
2728

2829
// Use a new environment for each test, to avoid any existing state from the
2930
// previous session.
30-
sandbox, editor, awaiter, err := connectEditor(dir)
31+
sandbox, editor, awaiter, err := connectEditor(dir, fake.EditorConfig{
32+
Settings: map[string]interface{}{
33+
"completionBudget": "1m", // arbitrary long completion budget
34+
},
35+
})
3136
if err != nil {
3237
b.Fatal(err)
3338
}
@@ -45,11 +50,10 @@ func benchmarkCompletion(options completionBenchOptions, b *testing.B) {
4550
Sandbox: sandbox,
4651
Awaiter: awaiter,
4752
}
48-
env.OpenFile(options.file)
4953

5054
// Run edits required for this completion.
51-
if options.preCompletionEdits != nil {
52-
options.preCompletionEdits(env)
55+
if options.setup != nil {
56+
options.setup(env)
5357
}
5458

5559
// Run a completion to make sure the system is warm.
@@ -70,6 +74,9 @@ func benchmarkCompletion(options completionBenchOptions, b *testing.B) {
7074
// initialization).
7175
b.Run("completion", func(b *testing.B) {
7276
for i := 0; i < b.N; i++ {
77+
if options.beforeCompletion != nil {
78+
options.beforeCompletion(env)
79+
}
7380
env.Completion(options.file, pos)
7481
}
7582
})
@@ -92,7 +99,7 @@ func endPosInBuffer(env *Env, name string) fake.Pos {
9299
func BenchmarkStructCompletion(b *testing.B) {
93100
file := "internal/lsp/cache/session.go"
94101

95-
preCompletionEdits := func(env *Env) {
102+
setup := func(env *Env) {
96103
env.OpenFile(file)
97104
originalBuffer := env.Editor.BufferText(file)
98105
env.EditBuffer(file, fake.Edit{
@@ -102,25 +109,27 @@ func BenchmarkStructCompletion(b *testing.B) {
102109
}
103110

104111
benchmarkCompletion(completionBenchOptions{
105-
file: file,
106-
locationRegexp: `var testVariable map\[string\]bool = Session{}(\.)`,
107-
preCompletionEdits: preCompletionEdits,
112+
file: file,
113+
locationRegexp: `var testVariable map\[string\]bool = Session{}(\.)`,
114+
setup: setup,
108115
}, b)
109116
}
110117

111118
// Benchmark import completion in tools codebase.
112119
func BenchmarkImportCompletion(b *testing.B) {
120+
const file = "internal/lsp/source/completion/completion.go"
113121
benchmarkCompletion(completionBenchOptions{
114-
file: "internal/lsp/source/completion/completion.go",
122+
file: file,
115123
locationRegexp: `go\/()`,
124+
setup: func(env *Env) { env.OpenFile(file) },
116125
}, b)
117126
}
118127

119128
// Benchmark slice completion in tools codebase.
120129
func BenchmarkSliceCompletion(b *testing.B) {
121130
file := "internal/lsp/cache/session.go"
122131

123-
preCompletionEdits := func(env *Env) {
132+
setup := func(env *Env) {
124133
env.OpenFile(file)
125134
originalBuffer := env.Editor.BufferText(file)
126135
env.EditBuffer(file, fake.Edit{
@@ -130,9 +139,9 @@ func BenchmarkSliceCompletion(b *testing.B) {
130139
}
131140

132141
benchmarkCompletion(completionBenchOptions{
133-
file: file,
134-
locationRegexp: `var testVariable \[\]byte (=)`,
135-
preCompletionEdits: preCompletionEdits,
142+
file: file,
143+
locationRegexp: `var testVariable \[\]byte (=)`,
144+
setup: setup,
136145
}, b)
137146
}
138147

@@ -144,7 +153,7 @@ func (c *completer) _() {
144153
c.inference.kindMatches(c.)
145154
}
146155
`
147-
preCompletionEdits := func(env *Env) {
156+
setup := func(env *Env) {
148157
env.OpenFile(file)
149158
originalBuffer := env.Editor.BufferText(file)
150159
env.EditBuffer(file, fake.Edit{
@@ -154,8 +163,42 @@ func (c *completer) _() {
154163
}
155164

156165
benchmarkCompletion(completionBenchOptions{
157-
file: file,
158-
locationRegexp: `func \(c \*completer\) _\(\) {\n\tc\.inference\.kindMatches\((c)`,
159-
preCompletionEdits: preCompletionEdits,
166+
file: file,
167+
locationRegexp: `func \(c \*completer\) _\(\) {\n\tc\.inference\.kindMatches\((c)`,
168+
setup: setup,
169+
}, b)
170+
}
171+
172+
// Benchmark completion following an arbitrary edit.
173+
//
174+
// Edits force type-checked packages to be invalidated, so we want to measure
175+
// how long it takes before completion results are available.
176+
func BenchmarkCompletionFollowingEdit(b *testing.B) {
177+
file := "internal/lsp/source/completion/completion2.go"
178+
fileContent := `
179+
package completion
180+
181+
func (c *completer) _() {
182+
c.inference.kindMatches(c.)
183+
// __MAGIC_STRING_1
184+
}
185+
`
186+
setup := func(env *Env) {
187+
env.CreateBuffer(file, fileContent)
188+
}
189+
190+
n := 1
191+
beforeCompletion := func(env *Env) {
192+
old := fmt.Sprintf("__MAGIC_STRING_%d", n)
193+
new := fmt.Sprintf("__MAGIC_STRING_%d", n+1)
194+
n++
195+
env.RegexpReplace(file, old, new)
196+
}
197+
198+
benchmarkCompletion(completionBenchOptions{
199+
file: file,
200+
locationRegexp: `func \(c \*completer\) _\(\) {\n\tc\.inference\.kindMatches\((c)`,
201+
setup: setup,
202+
beforeCompletion: beforeCompletion,
160203
}, b)
161204
}

gopls/internal/regtest/bench/iwl_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"context"
99
"testing"
1010

11+
"golang.org/x/tools/internal/lsp/fake"
1112
. "golang.org/x/tools/internal/lsp/regtest"
1213
)
1314

@@ -19,7 +20,7 @@ func BenchmarkIWL(b *testing.B) {
1920

2021
ctx := context.Background()
2122
for i := 0; i < b.N; i++ {
22-
_, editor, awaiter, err := connectEditor(dir)
23+
_, editor, awaiter, err := connectEditor(dir, fake.EditorConfig{})
2324
if err != nil {
2425
b.Fatal(err)
2526
}

gopls/internal/regtest/diagnostics/diagnostics_test.go

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ func Hello() {
15481548
}
15491549
-- go.mod --
15501550
module mod.com
1551-
-- main.go --
1551+
-- cmd/main.go --
15521552
package main
15531553
15541554
import "mod.com/bob"
@@ -1558,11 +1558,12 @@ func main() {
15581558
}
15591559
`
15601560
Run(t, mod, func(t *testing.T, env *Env) {
1561+
env.Await(FileWatchMatching("bob"))
15611562
env.RemoveWorkspaceFile("bob")
15621563
env.Await(
1563-
env.DiagnosticAtRegexp("main.go", `"mod.com/bob"`),
1564+
env.DiagnosticAtRegexp("cmd/main.go", `"mod.com/bob"`),
15641565
EmptyDiagnostics("bob/bob.go"),
1565-
RegistrationMatching("didChangeWatchedFiles"),
1566+
NoFileWatchMatching("bob"),
15661567
)
15671568
})
15681569
}
@@ -1692,57 +1693,6 @@ import (
16921693
})
16931694
}
16941695

1695-
func TestMultipleModules_Warning(t *testing.T) {
1696-
const modules = `
1697-
-- a/go.mod --
1698-
module a.com
1699-
1700-
go 1.12
1701-
-- a/a.go --
1702-
package a
1703-
-- b/go.mod --
1704-
module b.com
1705-
1706-
go 1.12
1707-
-- b/b.go --
1708-
package b
1709-
`
1710-
for _, go111module := range []string{"on", "auto"} {
1711-
t.Run("GO111MODULE="+go111module, func(t *testing.T) {
1712-
WithOptions(
1713-
Modes(Default),
1714-
EnvVars{"GO111MODULE": go111module},
1715-
).Run(t, modules, func(t *testing.T, env *Env) {
1716-
env.OpenFile("a/a.go")
1717-
env.OpenFile("b/go.mod")
1718-
env.Await(
1719-
env.DiagnosticAtRegexp("a/a.go", "package a"),
1720-
env.DiagnosticAtRegexp("b/go.mod", "module b.com"),
1721-
OutstandingWork(lsp.WorkspaceLoadFailure, "gopls requires a module at the root of your workspace."),
1722-
)
1723-
})
1724-
})
1725-
}
1726-
1727-
// Expect no warning if GO111MODULE=auto in a directory in GOPATH.
1728-
t.Run("GOPATH_GO111MODULE_auto", func(t *testing.T) {
1729-
WithOptions(
1730-
Modes(Default),
1731-
EnvVars{"GO111MODULE": "auto"},
1732-
InGOPATH(),
1733-
).Run(t, modules, func(t *testing.T, env *Env) {
1734-
env.OpenFile("a/a.go")
1735-
env.Await(
1736-
OnceMet(
1737-
env.DoneWithOpen(),
1738-
EmptyDiagnostics("a/a.go"),
1739-
),
1740-
NoOutstandingWork(),
1741-
)
1742-
})
1743-
})
1744-
}
1745-
17461696
func TestNestedModules(t *testing.T) {
17471697
const proxy = `
17481698
-- [email protected]/go.mod --

0 commit comments

Comments
 (0)