diff --git a/config/file/format.go b/config/file/format.go index 9e20e60b12a..6cce7d7b1b2 100644 --- a/config/file/format.go +++ b/config/file/format.go @@ -3,8 +3,8 @@ package file import "strings" func format(name string) string { - if p := strings.Split(name, "."); len(p) > 1 { - return p[len(p)-1] + if idx := strings.LastIndex(name, "."); idx >= 0 { + return name[idx+1:] } return "" }