Skip to content

Commit 1d129bc

Browse files
committed
add 3 function for modifying ‘allowSuffixExt’
1 parent 38fddcb commit 1d129bc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tree.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,3 +637,20 @@ func pathClean(path string) string {
637637
}
638638
return strings.Replace(path, `//`, "/", -1)
639639
}
640+
641+
func AddSuffixExt(extString string) {
642+
allowSuffixExt = append(allowSuffixExt, extString)
643+
}
644+
645+
func RemoveSuffixExt(extString string) {
646+
for k, v := range allowSuffixExt {
647+
if extString == v {
648+
allowSuffixExt = append(allowSuffixExt[:k], allowSuffixExt[k+1:]...)
649+
break
650+
}
651+
}
652+
}
653+
654+
func GetSuffixExts() []string {
655+
return allowSuffixExt
656+
}

0 commit comments

Comments
 (0)