diff options
| author | Julie Qiu <julie@golang.org> | 2020-09-30 22:01:20 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-10-01 19:51:57 +0000 |
| commit | 567e0cd07b16e2ef91df42595b8d1aa229127f59 (patch) | |
| tree | 064b7c65bd28d06a6515b4f13806a44768adb561 /internal/testing/sample | |
| parent | a7dc5d4d1de69cee58d38866ad5c42aa0025bb64 (diff) | |
| download | go-x-pkgsite-567e0cd07b16e2ef91df42595b8d1aa229127f59.tar.xz | |
internal/testing/sample: combine ModuleInfo and ModuleInfoReleaseType
ModuleInfo and ModuleInfoReleaseType are effectively the same function
and are combined.
internal/frontend/directory_test.go also no longer creates ModuleInfos
with version=latest.
Change-Id: Ib14f39fd2ddf6afec57c43b0b09bda42c1a8b508
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258598
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/testing/sample')
| -rw-r--r-- | internal/testing/sample/legacy.go | 2 | ||||
| -rw-r--r-- | internal/testing/sample/sample.go | 7 |
2 files changed, 1 insertions, 8 deletions
diff --git a/internal/testing/sample/legacy.go b/internal/testing/sample/legacy.go index 59fa3fb0..6aa91d88 100644 --- a/internal/testing/sample/legacy.go +++ b/internal/testing/sample/legacy.go @@ -40,7 +40,7 @@ func LegacyPackage(modulePath, suffix string) *internal.LegacyPackage { } func LegacyModuleInfo(modulePath, versionString string) *internal.LegacyModuleInfo { - mi := ModuleInfoReleaseType(modulePath, versionString) + mi := ModuleInfo(modulePath, versionString) return &internal.LegacyModuleInfo{ ModuleInfo: *mi, LegacyReadmeFilePath: ReadmeFilePath, diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index de80a691..1d024bb4 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -104,13 +104,6 @@ func PackageMeta(fullPath string) *internal.PackageMeta { } func ModuleInfo(modulePath, versionString string) *internal.ModuleInfo { - mi := ModuleInfoReleaseType(modulePath, versionString) - return mi -} - -// We shouldn't need this, but some code (notably frontend/directory_test.go) creates -// ModuleInfos with "latest" for version, which should not be valid. -func ModuleInfoReleaseType(modulePath, versionString string) *internal.ModuleInfo { return &internal.ModuleInfo{ ModulePath: modulePath, Version: versionString, |
