Fix context usages (#35348)

This commit is contained in:
wxiaoguang
2025-08-27 19:00:01 +08:00
committed by GitHub
parent da5ce5c8e7
commit e837c998b7
48 changed files with 98 additions and 100 deletions

View File

@ -83,13 +83,13 @@ func (pd *PackageDescriptor) VersionWebLink() string {
}
// PackageHTMLURL returns the absolute package HTML URL
func (pd *PackageDescriptor) PackageHTMLURL() string {
return fmt.Sprintf("%s/-/packages/%s/%s", pd.Owner.HTMLURL(), string(pd.Package.Type), url.PathEscape(pd.Package.LowerName))
func (pd *PackageDescriptor) PackageHTMLURL(ctx context.Context) string {
return fmt.Sprintf("%s/-/packages/%s/%s", pd.Owner.HTMLURL(ctx), string(pd.Package.Type), url.PathEscape(pd.Package.LowerName))
}
// VersionHTMLURL returns the absolute package version HTML URL
func (pd *PackageDescriptor) VersionHTMLURL() string {
return fmt.Sprintf("%s/%s", pd.PackageHTMLURL(), url.PathEscape(pd.Version.LowerVersion))
func (pd *PackageDescriptor) VersionHTMLURL(ctx context.Context) string {
return fmt.Sprintf("%s/%s", pd.PackageHTMLURL(ctx), url.PathEscape(pd.Version.LowerVersion))
}
// CalculateBlobSize returns the total blobs size in bytes