Go: Use slices.Concat for bazelPaths

This commit is contained in:
Michael B. Gale
2024-03-04 10:39:48 +00:00
parent 040a288bb3
commit 020eb4aed7

View File

@@ -471,8 +471,10 @@ func getBuildRoots(emitDiagnostics bool) (goWorkspaces []GoWorkspace, totalModul
// Finds Go workspaces in the current working directory.
func GetWorkspaceInfo(emitDiagnostics bool) []GoWorkspace {
bazelPaths := util.FindAllFilesWithName(".", "BUILD", "vendor")
bazelPaths = append(bazelPaths, util.FindAllFilesWithName(".", "BUILD.bazel", "vendor")...)
bazelPaths := slices.Concat(
util.FindAllFilesWithName(".", "BUILD", "vendor"),
util.FindAllFilesWithName(".", "BUILD.bazel", "vendor"),
)
if len(bazelPaths) > 0 {
// currently not supported
if emitDiagnostics {