Skip to content

Commit 1055e77

Browse files
committed
Go: Export InitGoModForLegacyProject
1 parent 4387c73 commit 1055e77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

go/extractor/project/project.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func checkDirsNested(inputDirs []string) (string, bool) {
128128
var filesToRemove []string = []string{}
129129

130130
// Try to initialize a go.mod file for projects that do not already have one.
131-
func initGoModForLegacyProject(path string) {
131+
func InitGoModForLegacyProject(path string) {
132132
log.Printf("Project appears to be a legacy Go project, attempting to initialize go.mod in %s\n", path)
133133

134134
modInit := toolchain.InitModule(path)
@@ -395,7 +395,7 @@ func getBuildRoots(emitDiagnostics bool) (goWorkspaces []GoWorkspace, totalModul
395395
}
396396

397397
// Try to initialize a `go.mod` file automatically.
398-
initGoModForLegacyProject(".")
398+
InitGoModForLegacyProject(".")
399399

400400
goWorkspaces = []GoWorkspace{{
401401
BaseDir: ".",
@@ -437,7 +437,7 @@ func getBuildRoots(emitDiagnostics bool) (goWorkspaces []GoWorkspace, totalModul
437437

438438
// Try to initialize a `go.mod` file automatically for the stray source files.
439439
if !slices.Contains(goModDirs, path) {
440-
initGoModForLegacyProject(path)
440+
InitGoModForLegacyProject(path)
441441
goWorkspaces = append(goWorkspaces, GoWorkspace{
442442
BaseDir: path,
443443
Modules: loadGoModules([]string{filepath.Join(path, "go.mod")}),

0 commit comments

Comments
 (0)