update go mod
This commit is contained in:
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 + " 暂不支持当前格式的文件解析")
|
||||
|
Reference in New Issue
Block a user