Use selected module for dependency downloads

This commit is contained in:
2026-11-01 21:12:22 +00:00
parent 5aba4c6c87
commit 05f1b472fc
5 changed files with 11 additions and 6 deletions

View File

@@ -97,7 +97,7 @@ func New(ctx context.Context, directory string) (*Tool, error) {
func PrepareBuildDependencies(ctx context.Context, directory string) error {
captured := &combinedWriter{}
err := process.Run(ctx, process.Invocation{
Args: []string{"go", "mod", "download"},
Args: []string{"go", "mod", "download", "-modfile="},
Dir: directory,
Env: map[string]string{
"GOWORK": "off",

View File

@@ -159,7 +159,7 @@ func TestPrepareBuildDependenciesPreservesPreparationEnvironment(t *testing.T) {
if err := json.Unmarshal(contents, &record); err != nil {
t.Fatal(err)
}
if strings.Join(record.Arguments, " ") != "mod download" || record.Directory != repository {
if strings.Join(record.Arguments, " ") != "mod download -modfile=" || record.Directory != repository {
t.Fatalf("Go invocation = %#v", record)
}
if record.Workspace != "off" || record.Toolchain != "local" {