aboutsummaryrefslogtreecommitdiff
path: root/internal/testing/sample/sample.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2020-06-09 12:41:07 -0400
committerJulie Qiu <julieqiu@google.com>2020-06-09 21:15:16 +0000
commit5f3d28792fdeabf75b026a258b05935d1bfb8417 (patch)
treea1b47742bc1a4177a84d78f6f0fb38be7b42bc46 /internal/testing/sample/sample.go
parentb663f47268034db631fec0c41fe1bd7864b8edf6 (diff)
downloadgo-x-pkgsite-5f3d28792fdeabf75b026a258b05935d1bfb8417.tar.xz
internal: rename ModuleInfo to LegacyModuleInfo
ModuleInfo is renamed to LegacyModuleInfo, as a step towards deprecating LegacyReadmeFilePath and LegacyReadmeContents. In a follow up CL, we will add ModuleInfo as an embedded struct to LegacyModuleInfo. Change-Id: Ie452420448eec1d13edaf62e548df0b9e2cbbe4b Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/766479 CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/testing/sample/sample.go')
-rw-r--r--internal/testing/sample/sample.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go
index c63df1a2..e3d5bc17 100644
--- a/internal/testing/sample/sample.go
+++ b/internal/testing/sample/sample.go
@@ -105,7 +105,7 @@ func LegacyPackage(modulePath, suffix string) *internal.LegacyPackage {
}
}
-func ModuleInfo(modulePath, versionString string) *internal.ModuleInfo {
+func LegacyModuleInfo(modulePath, versionString string) *internal.LegacyModuleInfo {
vtype, err := version.ParseType(versionString)
if err != nil {
panic(err)
@@ -117,8 +117,8 @@ func ModuleInfo(modulePath, versionString string) *internal.ModuleInfo {
// 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{
+func ModuleInfoReleaseType(modulePath, versionString string) *internal.LegacyModuleInfo {
+ return &internal.LegacyModuleInfo{
ModulePath: modulePath,
Version: versionString,
LegacyReadmeFilePath: ReadmeFilePath,
@@ -141,11 +141,11 @@ func DefaultModule() *internal.Module {
// 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 {
- mi := ModuleInfo(modulePath, version)
+ mi := LegacyModuleInfo(modulePath, version)
m := &internal.Module{
- ModuleInfo: *mi,
- LegacyPackages: nil,
- Licenses: Licenses,
+ LegacyModuleInfo: *mi,
+ LegacyPackages: nil,
+ Licenses: Licenses,
Directories: []*internal.DirectoryNew{
DirectoryNewForModuleRoot(mi, LicenseMetadata),
},
@@ -191,7 +191,7 @@ func DirectoryNewEmpty(path string) *internal.DirectoryNew {
}
}
-func DirectoryNewForModuleRoot(m *internal.ModuleInfo, licenses []*licenses.Metadata) *internal.DirectoryNew {
+func DirectoryNewForModuleRoot(m *internal.LegacyModuleInfo, licenses []*licenses.Metadata) *internal.DirectoryNew {
d := &internal.DirectoryNew{
Path: m.ModulePath,
IsRedistributable: m.IsRedistributable,