feat(dependencies): 更新 go.mod 和 go.sum 文件,添加新依赖并优化现有依赖版本

在 go.mod 中添加了多个新依赖,包括用于微服务架构、数据库支持、缓存和消息队列的库。同时,更新了 go.sum 文件以反映这些更改。README.md 文件也进行了相应的更新,增加了微服务架构的描述和功能模块的详细信息,确保文档与代码保持一致。
This commit is contained in:
2025-09-27 00:41:27 +08:00
parent 25386cf0e1
commit 9f70704081
7 changed files with 549 additions and 48 deletions

View File

@@ -195,7 +195,7 @@ func DownloadFile(url, saveTo string, fb func(length, downLen int64)) {
resp, err := client.Get(url)
if err != nil {
fmt.Printf("download %s error:%s\n", url, err)
os.Exit(0)
return
}
//读取服务器返回的文件大小
fsize, err = strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 32)
@@ -207,12 +207,12 @@ func DownloadFile(url, saveTo string, fb func(length, downLen int64)) {
file.Chmod(0777)
if err != nil {
fmt.Printf("Create %s error:%s\n", saveTo, err)
os.Exit(0)
return
}
defer file.Close()
if resp.Body == nil {
fmt.Printf("resp %s error:%s\n", url, err)
os.Exit(0)
return
}
defer resp.Body.Close()
//下面是 io.copyBuffer() 的简化版本
@@ -250,6 +250,6 @@ func DownloadFile(url, saveTo string, fb func(length, downLen int64)) {
if err != nil {
fmt.Printf("callback error:%s\n", err)
os.Exit(0)
return
}
}