init repo

This commit is contained in:
2024-09-14 22:39:50 +08:00
commit e8314a95bf
14 changed files with 785 additions and 0 deletions

11
utils/file.go Normal file
View File

@@ -0,0 +1,11 @@
package utils
import (
"path/filepath"
"strings"
)
func ReplaceExtension(filepathStr, newExt string) string {
ext := filepath.Ext(filepathStr)
return strings.TrimSuffix(filepathStr, ext) + newExt
}