@@ -139,9 +139,6 @@ type Invocation struct {
139
139
// If ModFile is set, the go command is invoked with -modfile=ModFile.
140
140
ModFile string
141
141
142
- // If WorkFile is set, the go command is invoked with -workfile=WorkFile.
143
- WorkFile string
144
-
145
142
// If Overlay is set, the go command is invoked with -overlay=Overlay.
146
143
Overlay string
147
144
@@ -170,9 +167,6 @@ func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io
170
167
}
171
168
172
169
func (i * Invocation ) run (ctx context.Context , stdout , stderr io.Writer ) error {
173
- if i .ModFile != "" && i .WorkFile != "" {
174
- return fmt .Errorf ("bug: go command invoked with both -modfile and -workfile" )
175
- }
176
170
log := i .Logf
177
171
if log == nil {
178
172
log = func (string , ... interface {}) {}
@@ -185,11 +179,6 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error {
185
179
goArgs = append (goArgs , "-modfile=" + i .ModFile )
186
180
}
187
181
}
188
- appendWorkFile := func () {
189
- if i .WorkFile != "" {
190
- goArgs = append (goArgs , "-workfile=" + i .WorkFile )
191
- }
192
- }
193
182
appendModFlag := func () {
194
183
if i .ModFlag != "" {
195
184
goArgs = append (goArgs , "-mod=" + i .ModFlag )
@@ -208,19 +197,16 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error {
208
197
// mod needs the sub-verb before flags.
209
198
goArgs = append (goArgs , i .Args [0 ])
210
199
appendModFile ()
211
- appendWorkFile ()
212
200
goArgs = append (goArgs , i .Args [1 :]... )
213
201
case "get" :
214
202
goArgs = append (goArgs , i .BuildFlags ... )
215
203
appendModFile ()
216
- appendWorkFile ()
217
204
goArgs = append (goArgs , i .Args ... )
218
205
219
206
default : // notably list and build.
220
207
goArgs = append (goArgs , i .BuildFlags ... )
221
208
appendModFile ()
222
209
appendModFlag ()
223
- appendWorkFile ()
224
210
appendOverlayFlag ()
225
211
goArgs = append (goArgs , i .Args ... )
226
212
}
0 commit comments