Skip to content

Commit

Permalink
fix: importing package with same prefix name
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Nov 29, 2024
1 parent 9b65b30 commit f3a167a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ func isLocalLocator(locator string) bool {
}

func shouldBlockAbsoluteLocatorBecauseIsInTheSameSourceModuleLocatorPackage(relativeOrAbsoluteLocator string, sourceModuleLocator string, rootPackageId string) bool {
// Make sure the root package id ends with a trailing slash.
rootPackageId = strings.TrimPrefix(rootPackageId, "/") + "/"
isSourceModuleInRootPackage := strings.HasPrefix(sourceModuleLocator, rootPackageId)
isAbsoluteLocatorInRootPackage := strings.HasPrefix(relativeOrAbsoluteLocator, rootPackageId)
return isSourceModuleInRootPackage && isAbsoluteLocatorInRootPackage
Expand Down

0 comments on commit f3a167a

Please sign in to comment.