Finalizing behavior for variants

This commit is contained in:
Alex Yatskov 2015-09-04 17:15:30 +09:00
parent d124cd8ece
commit 56ff12d36b

View File

@ -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