Skip to content

Commit a0a243d

Browse files
1911860538huangzwtonybase
authored
perf(config/file): optimize file format func (#3610)
Co-authored-by: huangzw <[email protected]> Co-authored-by: Tony.Chen <[email protected]>
1 parent 5617ff3 commit a0a243d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

config/file/format.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package file
33
import "strings"
44

55
func format(name string) string {
6-
if p := strings.Split(name, "."); len(p) > 1 {
7-
return p[len(p)-1]
6+
if idx := strings.LastIndex(name, "."); idx >= 0 {
7+
return name[idx+1:]
88
}
99
return ""
1010
}

0 commit comments

Comments
 (0)