1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-25 19:58:36 +00:00

Fix error logs and improve some comments/messages (#35105)

This commit is contained in:
wxiaoguang
2025-07-17 19:09:54 +08:00
committed by GitHub
parent 891a827158
commit de1114b4e8
14 changed files with 19 additions and 41 deletions

View File

@@ -14,7 +14,6 @@ import (
packages_model "code.gitea.io/gitea/models/packages"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/optional"
packages_module "code.gitea.io/gitea/modules/packages"
helm_module "code.gitea.io/gitea/modules/packages/helm"
@@ -86,16 +85,14 @@ func Index(ctx *context.Context) {
}
ctx.Resp.WriteHeader(http.StatusOK)
if err := yaml.NewEncoder(ctx.Resp).Encode(&Index{
_ = yaml.NewEncoder(ctx.Resp).Encode(&Index{
APIVersion: "v1",
Entries: entries,
Generated: time.Now(),
ServerInfo: &ServerInfo{
ContextPath: setting.AppSubURL + "/api/packages/" + url.PathEscape(ctx.Package.Owner.Name) + "/helm",
},
}); err != nil {
log.Error("YAML encode failed: %v", err)
}
})
}
// DownloadPackageFile serves the content of a package