aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2021-01-31 22:06:02 -0500
committerJulie Qiu <julie@golang.org>2021-02-12 21:21:49 +0000
commit84574e5b8d2668d5f07f7bb7ee8ae19b7dfd22c3 (patch)
treeb8899f1ea02590b019c7ab211f03088c135d7388 /internal/postgres/insert_module.go
parentf8709641a5977032e1529f9f642a864e31c2604c (diff)
downloadgo-x-pkgsite-84574e5b8d2668d5f07f7bb7ee8ae19b7dfd22c3.tar.xz
content,internal: update versions page
The versions page is updated to: - Display incompatible versions in a separate section - Remove minor versions of other modules A version.IsIncompatible function is added to the internal/version package for determining if a version is an incompatible version. Mock: https://photos.app.goo.gl/wWEFsMrmtaxggTAk7 Change-Id: I9a1c533066c3ea8b3f9f9b65f9bd171290655b5e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288762 Trust: Julie Qiu <julie@golang.org> 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.go')
-rw-r--r--internal/postgres/insert_module.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index 8d68bece..1d979a84 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -205,7 +205,7 @@ func insertModule(ctx context.Context, db *database.DB, m *internal.Module) (_ i
m.IsRedistributable,
m.HasGoMod,
m.DeprecatedComment,
- isIncompatible(m.Version),
+ version.IsIncompatible(m.Version),
).Scan(&moduleID)
if err != nil {
return 0, err
@@ -581,12 +581,6 @@ func lock(ctx context.Context, tx *database.DB, modulePath string) (err error) {
return nil
}
-// isIncompatible reports whether the build metadata of the version is
-// "+incompatible", https://semver.org clause 10.
-func isIncompatible(version string) bool {
- return strings.HasSuffix(version, "+incompatible")
-}
-
// isLatestVersion reports whether version is the latest version of the module.
func isLatestVersion(ctx context.Context, ddb *database.DB, modulePath, resolvedVersion string) (_ bool, err error) {
defer derrors.WrapStack(&err, "isLatestVersion(ctx, tx, %q)", modulePath)