diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index bba1df3799a8..97f5ac88c227 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -37,10 +37,12 @@ function Get-GoModuleVersionInfo($modPath) function Get-GoModuleProperties($goModPath) { $goModPath = $goModPath -replace "\\", "/" - if ($goModPath -match "(?sdk/(?(resourcemanager/)?([^/]+/)?(?[^/]+$)))") + # We should keep this regex in sync with what is in the azure-sdk repo at https://github.com/Azure/azure-sdk/blob/main/eng/scripts/Query-Azure-Packages.ps1#L227 + # The serviceName named capture group is unused but used in azure-sdk, so it's kept here for parity + if ($goModPath -match "(?sdk/(?(.*?(?[^/]+)/)?(?[^/]+$)))") { $modPath = $matches["modPath"] - $modName = $matches["modName"] # We may need to start readong this from the go.mod file if the path and mod config start to differ + $modName = $matches["modName"] # We may need to start reading this from the go.mod file if the path and mod config start to differ $serviceDir = $matches["serviceDir"] $sdkType = "client" if ($modName.StartsWith("arm") -or $modPath.Contains("resourcemanager")) { $sdkType = "mgmt" } @@ -143,4 +145,4 @@ function Find-Go-Artifacts-For-Apireview($ArtifactPath, $PackageName) return $packages } return $null -} \ No newline at end of file +}