diff options
| author | Bharath Thiruveedula <tbharath91@gmail.com> | 2020-06-19 10:35:31 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-06-29 18:15:37 +0000 |
| commit | fbef9da64db31dae662aa4cb857eaaff561ce40e (patch) | |
| tree | c67d0afde4e898ac64d857c4930fe5decf513c47 /internal/testing/sample/sample.go | |
| parent | bf0874fd2ae9ce273e4764dec2bd38e2b8444fd8 (diff) | |
| download | go-x-pkgsite-fbef9da64db31dae662aa4cb857eaaff561ce40e.tar.xz | |
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 <julie@golang.org>
Diffstat (limited to 'internal/testing/sample/sample.go')
| -rw-r--r-- | internal/testing/sample/sample.go | 12 |
1 files changed, 12 insertions, 0 deletions
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 { |
