aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2020-04-27 16:12:09 -0400
committerJonathan Amsterdam <jba@google.com>2020-04-29 20:56:42 +0000
commit0f995de2a3635609f7f95c2efc86e2dab4fcadf0 (patch)
tree9c453c709f35cc11365ae3543e86f97049d4b7f9 /internal/postgres/insert_module.go
parent21584e30257c7768c25dbe8a2dec7279ace4f84b (diff)
downloadgo-x-pkgsite-0f995de2a3635609f7f95c2efc86e2dab4fcadf0.tar.xz
internal/postgres: support for getting path info
Add GetPathInfo, a function that gets information about a path. The main handler would call either GetPathInfo(path, "unknown", "latest") if the incoming URL path had no "@", or GetPathInfo(path, "unknown", version) if the incoming path looked like "foo@v". Based on the returned path (or absence of one), it would decide whether to call GetDirectory, GetPackage or GetModule. Change-Id: Ifc09202d8ec110960e2c3bbaf04b79fc7a7c72df Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/728098 Reviewed-by: Julie Qiu <julieqiu@google.com>
Diffstat (limited to 'internal/postgres/insert_module.go')
-rw-r--r--internal/postgres/insert_module.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index 796b24c5..2ad399e8 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -328,7 +328,7 @@ func insertPackages(ctx context.Context, db *database.DB, m *internal.Module, is
}
func insertDirectories(ctx context.Context, db *database.DB, m *internal.Module, moduleID int) (err error) {
- defer derrors.Wrap(&err, "upsertDirectories(ctx, tx, %q, %q)", m.ModulePath, m.Version)
+ defer derrors.Wrap(&err, "insertDirectories(ctx, tx, %q, %q)", m.ModulePath, m.Version)
ctx, span := trace.StartSpan(ctx, "insertDirectories")
defer span.End()