From fbef9da64db31dae662aa4cb857eaaff561ce40e Mon Sep 17 00:00:00 2001 From: Bharath Thiruveedula Date: Fri, 19 Jun 2020 10:35:31 -0400 Subject: internal/postgres: remove module from version_map in DeleteModule postgres.DeleteModule is updated to delete the corresponding module_path and resolved_version row from the version_map table. Fixes #39633 Change-Id: I9de46b08e535bea52c2ea4dbab1c71a8e1c2c2f7 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/238637 Reviewed-by: Julie Qiu --- internal/testing/sample/sample.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'internal/testing/sample/sample.go') diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index 6f6af2cc..13e17aeb 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -9,6 +9,7 @@ package sample import ( "fmt" "math" + "net/http" "path" "strings" "time" @@ -150,6 +151,17 @@ func DefaultModule() *internal.Module { LegacyPackage(ModulePath, Suffix)) } +func DefaultVersionMap() *internal.VersionMap { + return &internal.VersionMap{ + ModulePath: ModulePath, + RequestedVersion: VersionString, + ResolvedVersion: VersionString, + Status: http.StatusOK, + GoModPath: "", + Error: "", + } +} + // Module creates a Module with the given path and version. // The list of suffixes is used to create LegacyPackages within the module. func Module(modulePath, version string, suffixes ...string) *internal.Module { -- cgit v1.3-5-g9baa