aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module_test.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2020-08-26 11:40:03 -0400
committerJulie Qiu <julie@golang.org>2020-08-26 21:45:32 +0000
commitd3ad0bfdce88103f1bd1d912f3f4b919aafda5b0 (patch)
tree72185f6f3e1d65104e6ff070fce36fc2ee999dd7 /internal/postgres/insert_module_test.go
parentc672ab816ca59651bc1d00f19938ed18cbcc4e61 (diff)
downloadgo-x-pkgsite-d3ad0bfdce88103f1bd1d912f3f4b919aafda5b0.tar.xz
internal: change signature of GetDirectory
The signature of GetDirectory is changed to: GetDirectory(ctx context.Context, fullPath, modulePath, version string, pathID int, fields []internal.FieldSet) (*internal.Directory, error) The allows the caller to pass in a pathID, if known, and specify specific fields that they want to fetch, for optimization. No functional changes to GetDirectory are made in this CL, just an update to the DatsSource interface, and how it is used in internal/frontend. For golang/go#39629 Change-Id: Ic44225a13bf2cf04a62af652dbb830c4d256cb37 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/250799 Run-TryBot: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/postgres/insert_module_test.go')
-rw-r--r--internal/postgres/insert_module_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go
index dcaaeb67..4ce028b6 100644
--- a/internal/postgres/insert_module_test.go
+++ b/internal/postgres/insert_module_test.go
@@ -111,7 +111,7 @@ func checkModule(ctx context.Context, t *testing.T, want *internal.Module) {
}
for _, dir := range want.Directories {
- got, err := testDB.GetDirectory(ctx, dir.Path, want.ModulePath, want.Version)
+ got, err := testDB.getDirectory(ctx, dir.Path, want.ModulePath, want.Version)
if err != nil {
t.Fatal(err)
}
@@ -185,7 +185,7 @@ func TestInsertModuleLicenseCheck(t *testing.T) {
checkHasRedistData(mi.LegacyReadmeContents, pkg.DocumentationHTML, bypass)
// New model
- dir, err := db.GetDirectory(ctx, mod.ModulePath, mod.ModulePath, mod.Version)
+ dir, err := db.getDirectory(ctx, mod.ModulePath, mod.ModulePath, mod.Version)
if err != nil {
t.Fatal(err)
}