update go mod
This commit is contained in:
parent
ba6140d547
commit
e6ad534a9a
9
file.go
9
file.go
@ -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 + " 暂不支持当前格式的文件解析")
|
||||
|
2
go.mod
2
go.mod
@ -8,3 +8,5 @@ require (
|
||||
github.com/go-ini/ini v1.67.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
require git.zhangdeman.cn/zhangdeman/consts v0.0.0-20230811030300-6f850372c88c // indirect
|
||||
|
2
go.sum
2
go.sum
@ -1,3 +1,5 @@
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20230811030300-6f850372c88c h1:Dan3iSVU6XTKt8r3/qixfPHPpfLZjkYlPmaJios7wtE=
|
||||
git.zhangdeman.cn/zhangdeman/consts v0.0.0-20230811030300-6f850372c88c/go.mod h1:IXXaZkb7vGzGnGM5RRWrASAuwrVSNxuoe0DmeXx5g6k=
|
||||
git.zhangdeman.cn/zhangdeman/util v0.0.0-20230810093304-ccb4045065c4 h1:MgZ2f1BkUtfP8D6uDX9S8o+V4wYUw76HlAw3xCH9epA=
|
||||
git.zhangdeman.cn/zhangdeman/util v0.0.0-20230810093304-ccb4045065c4/go.mod h1:tPl6isAsRQLZrX8G3/8fCdhN4OcZypdmdHR/PDkd2PY=
|
||||
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
|
||||
|
Loading…
Reference in New Issue
Block a user