update go mod

This commit is contained in:
2023-08-11 11:28:17 +08:00
parent ba6140d547
commit e6ad534a9a
3 changed files with 9 additions and 4 deletions

View File

@ -9,6 +9,7 @@ package serialize
import (
"errors"
"git.zhangdeman.cn/zhangdeman/consts"
"io"
"net/http"
"os"
@ -141,13 +142,13 @@ func (f *file) ReadAnyFileContent(filePath string, receiver interface{}) error {
fileExt := strings.ToLower(fileInfoArr[len(fileInfoArr)-1])
switch fileExt {
case "json":
case consts.FileTypeJson:
parseFunc = f.ReadJSONContent
case "yml":
case consts.FileTypeYml:
fallthrough
case "yaml":
case consts.FileTypeYaml:
parseFunc = f.ReadYmlContent
case "ini":
case consts.FileTypeIni:
parseFunc = f.ReadIniContent
default:
return errors.New(fileExt + " 暂不支持当前格式的文件解析")