v3_1
This commit is contained in:
16
internal/pkg/convertor/path.go
Normal file
16
internal/pkg/convertor/path.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package convertor
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"management/internal/pkg/sliceutil"
|
||||
)
|
||||
|
||||
func HandleParentPath(parentPath string) string {
|
||||
parentPath = strings.ReplaceAll(parentPath, ",,", ",")
|
||||
paths := sliceutil.RemoveDuplicatesWithMap(strings.Split(parentPath, ","))
|
||||
sort.Strings(paths)
|
||||
parentPath = strings.Join(paths, ",") + ","
|
||||
return parentPath
|
||||
}
|
||||
Reference in New Issue
Block a user