From 7cfdb7f01c6a95923f8db72eddc63323fb5034f1 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 3 Apr 2024 00:54:19 +0200 Subject: [PATCH] fix: local module path matching Signed-off-by: Fernandez Ludovic --- pkg/section/local_module.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/section/local_module.go b/pkg/section/local_module.go index 5af74b3..50f41e5 100644 --- a/pkg/section/local_module.go +++ b/pkg/section/local_module.go @@ -18,7 +18,7 @@ type LocalModule struct { } func (m *LocalModule) MatchSpecificity(spec *parse.GciImports) specificity.MatchSpecificity { - if strings.HasPrefix(spec.Path, m.Path) { + if spec.Path == m.Path || strings.HasPrefix(spec.Path, m.Path+"/") { return specificity.LocalModule{} }