aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/unit.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-04-11 13:12:03 -0400
committerGopher Robot <gobot@golang.org>2022-04-11 21:55:57 +0000
commit8ea409f829091208d2d0ba4d81ecbe83b0fee9bb (patch)
tree0c0d0f5d753b722533b3bba32e3e23d4aa3059cd /internal/postgres/unit.go
parent7ca74fe938640d7c9e378dc8e5821b58313cdd68 (diff)
downloadgo-x-pkgsite-8ea409f829091208d2d0ba4d81ecbe83b0fee9bb.tar.xz
all: gofmt
Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: Ia9e71e7ecac75822ff43d6c7e60f512442a5fa50 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/399617 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/postgres/unit.go')
-rw-r--r--internal/postgres/unit.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/internal/postgres/unit.go b/internal/postgres/unit.go
index 200d5952..234990c7 100644
--- a/internal/postgres/unit.go
+++ b/internal/postgres/unit.go
@@ -26,14 +26,17 @@ import (
// If the module is unknown, pass internal.UnknownModulePath; if the version is unknown, pass
// internal.LatestVersion.
//
-// The rules for picking the best are:
+// The rules for picking the best are as follows.
+//
// 1. If the version is known but the module path is not, choose the longest module path
-// at that version that contains fullPath.
+// at that version that contains fullPath.
+//
// 2. Otherwise, find the latest "good" version (in the modules table) that contains fullPath.
-// a. First, follow the algorithm of the go command: prefer longer module paths, and
-// find the latest unretracted version, using semver but preferring release to pre-release.
-// b. If no modules have latest-version information, find the latest by sorting the versions
-// we do have: again first by module path length, then by version.
+//
+// a. First, follow the algorithm of the go command: prefer longer module paths, and
+// find the latest unretracted version, using semver but preferring release to pre-release.
+// b. If no modules have latest-version information, find the latest by sorting the versions
+// we do have: again first by module path length, then by version.
func (db *DB) GetUnitMeta(ctx context.Context, fullPath, requestedModulePath, requestedVersion string) (_ *internal.UnitMeta, err error) {
defer derrors.WrapStack(&err, "DB.GetUnitMeta(ctx, %q, %q, %q)", fullPath, requestedModulePath, requestedVersion)
defer middleware.ElapsedStat(ctx, "DB.GetUnitMeta")()