优化pkg官方源时间显示

This commit is contained in:
liyp 2024-04-18 21:13:15 +08:00
parent cc2d768474
commit b521264877

View file

@ -111,15 +111,16 @@ func (a *Pkg) GetMsg() string {
// fmt.Println("result:", result) // fmt.Println("result:", result)
// if result != nil { // if result != nil {
var msg string var msg string
last_update := result["last_update"].(string)
last_update = strings.Replace(last_update, "T", " ", 1)
last_update = strings.Replace(last_update, "Z", "", 1)
msg += "仓库:" + result["repo"].(string) + "\n" msg += "仓库:" + result["repo"].(string) + "\n"
msg += "包名:" + result["pkgname"].(string) + "\n" msg += "包名:" + result["pkgname"].(string) + "\n"
msg += "版本:" + result["pkgver"].(string) + "\n" msg += "版本:" + result["pkgver"].(string) + "\n"
msg += "描述:" + result["pkgdesc"].(string) + "\n" msg += "描述:" + result["pkgdesc"].(string) + "\n"
msg += "打包:" + result["packager"].(string) + "\n" msg += "打包:" + result["packager"].(string) + "\n"
msg += "链接:" + result["url"].(string) + "\n" msg += "链接:" + result["url"].(string) + "\n"
msg += "更新日期:" + result["last_update"].(string) msg += "更新日期:" + last_update
return msg return msg
} }