Skip to content

Commit 64122ba

Browse files
committed
Go: Include DependencyInstallerMode in GoWorkspace
1 parent 7392440 commit 64122ba

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

go/extractor/project/project.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ type GoModule struct {
3939
// Represents information about a Go project workspace: this may either be a folder containing
4040
// a `go.work` file or a collection of `go.mod` files.
4141
type GoWorkspace struct {
42-
BaseDir string // The base directory for this workspace
43-
UseGoMod bool // Whether to use modules or not
44-
WorkspaceFile *modfile.WorkFile // The `go.work` file for this workspace
45-
Modules []*GoModule // A list of `go.mod` files
42+
BaseDir string // The base directory for this workspace
43+
WorkspaceFile *modfile.WorkFile // The `go.work` file for this workspace
44+
Modules []*GoModule // A list of `go.mod` files
45+
DepMode DependencyInstallerMode // A value indicating how to install dependencies for this workspace
4646
}
4747

4848
// Determines whether any of the directory paths in the input are nested.
@@ -143,9 +143,9 @@ func discoverWorkspace(workFilePath string) GoWorkspace {
143143
// We couldn't read the `go.work` file for some reason; let's try to find `go.mod` files ourselves
144144
log.Printf("Unable to read %s, falling back to finding `go.mod` files manually:\n%s\n", workFilePath, err.Error())
145145
return GoWorkspace{
146-
BaseDir: baseDir,
147-
UseGoMod: true,
148-
Modules: loadGoModules(findGoModFiles(baseDir)),
146+
BaseDir: baseDir,
147+
Modules: loadGoModules(findGoModFiles(baseDir)),
148+
DepMode: GoGetWithModules,
149149
}
150150
}
151151

@@ -155,9 +155,9 @@ func discoverWorkspace(workFilePath string) GoWorkspace {
155155
// The `go.work` file couldn't be parsed for some reason; let's try to find `go.mod` files ourselves
156156
log.Printf("Unable to parse %s, falling back to finding `go.mod` files manually:\n%s\n", workFilePath, err.Error())
157157
return GoWorkspace{
158-
BaseDir: baseDir,
159-
UseGoMod: true,
160-
Modules: loadGoModules(findGoModFiles(baseDir)),
158+
BaseDir: baseDir,
159+
Modules: loadGoModules(findGoModFiles(baseDir)),
160+
DepMode: GoGetWithModules,
161161
}
162162
}
163163

@@ -177,9 +177,9 @@ func discoverWorkspace(workFilePath string) GoWorkspace {
177177

178178
return GoWorkspace{
179179
BaseDir: baseDir,
180-
UseGoMod: true,
181180
WorkspaceFile: workFile,
182181
Modules: loadGoModules(goModFilePaths),
182+
DepMode: GoGetWithModules,
183183
}
184184
}
185185

@@ -199,9 +199,9 @@ func discoverWorkspaces(emitDiagnostics bool) []GoWorkspace {
199199

200200
for i, goModFile := range goModFiles {
201201
results[i] = GoWorkspace{
202-
BaseDir: filepath.Dir(goModFile),
203-
UseGoMod: true,
204-
Modules: loadGoModules([]string{goModFile}),
202+
BaseDir: filepath.Dir(goModFile),
203+
Modules: loadGoModules([]string{goModFile}),
204+
DepMode: GoGetWithModules,
205205
}
206206
}
207207

0 commit comments

Comments
 (0)