Finalizing behavior for variants
This commit is contained in:
parent
d124cd8ece
commit
56ff12d36b
9
util.go
9
util.go
@ -48,9 +48,14 @@ func makeAbsPath(path string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func makeVariantNames(name, variant string) []string {
|
func makeVariantNames(name, variant string) []string {
|
||||||
names := []string{name, strings.TrimSuffix(name, "__")}
|
if nameParts := strings.Split(name, "__"); len(nameParts) > 1 {
|
||||||
|
variant = nameParts[len(nameParts)-1]
|
||||||
|
name = strings.Join(nameParts[:len(nameParts)-1], "")
|
||||||
|
}
|
||||||
|
|
||||||
|
names := []string{name}
|
||||||
if len(variant) > 0 && !strings.HasSuffix(name, "__") {
|
if len(variant) > 0 && !strings.HasSuffix(name, "__") {
|
||||||
names = []string{fmt.Sprint(name, "__", variant), name, strings.TrimSuffix(name, "__")}
|
names = []string{fmt.Sprint(name, "__", variant), name}
|
||||||
}
|
}
|
||||||
|
|
||||||
return names
|
return names
|
||||||
|
Loading…
Reference in New Issue
Block a user