Skip to content

Commit 9c3e7c1

Browse files
author
Dominik Przybyl
committed
minor
1 parent 4e918fe commit 9c3e7c1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/content/content.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"os"
1313
"path/filepath"
1414
"regexp"
15-
"sort"
1615
"strings"
1716
)
1817

@@ -166,7 +165,9 @@ func (c Manager) cleanNamespaces(path string, lines []string) []string {
166165
var rootResult []string
167166
for _, part := range strings.Split(line, " ") {
168167
groups = namespacePatternRegex.FindStringSubmatch(part)
169-
if groups != nil {
168+
if groups == nil {
169+
rootResult = append(rootResult, part)
170+
} else {
170171
flag := lo.SomeBy(lines, func(line string) bool {
171172
return strings.Contains(line, groups[1]+":") || groups[1] == fileNamespace
172173
})
@@ -175,8 +176,6 @@ func (c Manager) cleanNamespaces(path string, lines []string) []string {
175176
}
176177
}
177178
}
178-
sort.Strings(rootResult)
179-
rootResult = append([]string{JCRRootPrefix}, rootResult...)
180179
result = append(result, strings.Join(rootResult, " "))
181180
} else {
182181
result = append(result, line)

0 commit comments

Comments
 (0)