diff --git a/internal/frontend/tabs.go b/internal/frontend/tabs.go index bb748285..c139b00a 100644 --- a/internal/frontend/tabs.go +++ b/internal/frontend/tabs.go @@ -147,7 +147,7 @@ func legacyFetchDetailsForPackage(r *http.Request, tab string, ds internal.DataS case "doc": return legacyFetchDocumentationDetails(pkg), nil case "versions": - return fetchPackageVersionsDetails(ctx, ds, pkg.Path, pkg.V1Path, pkg.ModulePath) + return legacyFetchPackageVersionsDetails(ctx, ds, pkg.Path, pkg.V1Path, pkg.ModulePath) case "subdirectories": return legacyFetchDirectoryDetails(ctx, ds, pkg.Path, &pkg.ModuleInfo, pkg.Licenses, false) case "imports": @@ -179,7 +179,7 @@ func fetchDetailsForPackage(r *http.Request, tab string, ds internal.DataSource, case "subdirectories": return fetchDirectoryDetails(ctx, ds, vdir, false) case "versions": - return fetchPackageVersionsDetails(ctx, ds, vdir.Path, vdir.V1Path, vdir.ModulePath) + return legacyFetchPackageVersionsDetails(ctx, ds, vdir.Path, vdir.V1Path, vdir.ModulePath) case "imports": return fetchImportsDetails(ctx, ds, vdir.Path, vdir.ModulePath, vdir.Version) case "importedby": @@ -219,7 +219,7 @@ func fetchDetailsForModule(r *http.Request, tab string, ds internal.DataSource, case "licenses": return &LicensesDetails{Licenses: transformLicenses(mi.ModulePath, mi.Version, licenses)}, nil case "versions": - return fetchModuleVersionsDetails(ctx, ds, mi) + return legacyFetchModuleVersionsDetails(ctx, ds, mi) case "overview": return constructOverviewDetails(ctx, mi, readme, mi.IsRedistributable, urlIsVersioned(r.URL)) } diff --git a/internal/frontend/versions.go b/internal/frontend/versions.go index 0b191a58..84f6c3b0 100644 --- a/internal/frontend/versions.go +++ b/internal/frontend/versions.go @@ -60,9 +60,9 @@ type VersionSummary struct { Version string } -// fetchModuleVersionsDetails builds a version hierarchy for module versions +// legacyFetchModuleVersionsDetails builds a version hierarchy for module versions // with the same series path as the given version. -func fetchModuleVersionsDetails(ctx context.Context, ds internal.DataSource, mi *internal.ModuleInfo) (*VersionsDetails, error) { +func legacyFetchModuleVersionsDetails(ctx context.Context, ds internal.DataSource, mi *internal.ModuleInfo) (*VersionsDetails, error) { versions, err := ds.LegacyGetTaggedVersionsForModule(ctx, mi.ModulePath) if err != nil { return nil, err @@ -81,9 +81,9 @@ func fetchModuleVersionsDetails(ctx context.Context, ds internal.DataSource, mi return buildVersionDetails(mi.ModulePath, versions, linkify), nil } -// fetchPackageVersionsDetails builds a version hierarchy for all module +// legacyFetchPackageVersionsDetails builds a version hierarchy for all module // versions containing a package path with v1 import path matching the given v1 path. -func fetchPackageVersionsDetails(ctx context.Context, ds internal.DataSource, pkgPath, v1Path, modulePath string) (*VersionsDetails, error) { +func legacyFetchPackageVersionsDetails(ctx context.Context, ds internal.DataSource, pkgPath, v1Path, modulePath string) (*VersionsDetails, error) { versions, err := ds.LegacyGetTaggedVersionsForPackageSeries(ctx, pkgPath) if err != nil { return nil, err diff --git a/internal/frontend/versions_test.go b/internal/frontend/versions_test.go index 11f4cf26..a8870111 100644 --- a/internal/frontend/versions_test.go +++ b/internal/frontend/versions_test.go @@ -131,12 +131,12 @@ func TestFetchModuleVersionDetails(t *testing.T) { } } - got, err := fetchModuleVersionsDetails(ctx, testDB, tc.info) + got, err := legacyFetchModuleVersionsDetails(ctx, testDB, tc.info) if err != nil { - t.Fatalf("fetchModuleVersionsDetails(ctx, db, %v): %v", tc.info, err) + t.Fatalf("legacyFetchModuleVersionsDetails(ctx, db, %v): %v", tc.info, err) } if diff := cmp.Diff(tc.wantDetails, got); diff != "" { - t.Errorf("fetchModuleVersionsDetails(ctx, db, %v) mismatch (-want +got):\n%s", tc.info, diff) + t.Errorf("legacyFetchModuleVersionsDetails(ctx, db, %v) mismatch (-want +got):\n%s", tc.info, diff) } }) } @@ -259,12 +259,12 @@ func TestFetchPackageVersionsDetails(t *testing.T) { } } - got, err := fetchPackageVersionsDetails(ctx, testDB, tc.pkg.Path, tc.pkg.V1Path, tc.pkg.ModulePath) + got, err := legacyFetchPackageVersionsDetails(ctx, testDB, tc.pkg.Path, tc.pkg.V1Path, tc.pkg.ModulePath) if err != nil { - t.Fatalf("fetchPackageVersionsDetails(ctx, db, %v): %v", tc.pkg, err) + t.Fatalf("legacyFetchPackageVersionsDetails(ctx, db, %v): %v", tc.pkg, err) } if diff := cmp.Diff(tc.wantDetails, got); diff != "" { - t.Errorf("fetchPackageVersionsDetails(ctx, db, %v) mismatch (-want +got):\n%s", tc.pkg, diff) + t.Errorf("legacyFetchPackageVersionsDetails(ctx, db, %v) mismatch (-want +got):\n%s", tc.pkg, diff) } }) }