internal/fetch: do not return legacy readme data for FetchModule
fetch.FetchModule no longer returns LegacyReadmeFilePath and
LegacyReadmeContents.
For golang/go#39629
Change-Id: Iafd33c45ead827a0d4eb6a5f0733bb32ce9a8acf
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258566
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>
diff --git a/internal/fetch/fetch.go b/internal/fetch/fetch.go
index c72c961..0345c4f 100644
--- a/internal/fetch/fetch.go
+++ b/internal/fetch/fetch.go
@@ -273,15 +273,6 @@
}
hasGoMod := zipContainsFilename(zipReader, path.Join(moduleVersionDir(modulePath, resolvedVersion), "go.mod"))
- var readmeFilePath, readmeContents string
- for _, r := range readmes {
- if path.Dir(r.Filepath) != "." {
- continue
- }
- readmeFilePath = r.Filepath
- readmeContents = r.Contents
- break
- }
var legacyPackages []*internal.LegacyPackage
for _, p := range packages {
legacyPackages = append(legacyPackages, &internal.LegacyPackage{
@@ -307,8 +298,6 @@
HasGoMod: hasGoMod,
SourceInfo: sourceInfo,
},
- LegacyReadmeFilePath: readmeFilePath,
- LegacyReadmeContents: readmeContents,
},
LegacyPackages: legacyPackages,
Licenses: allLicenses,
diff --git a/internal/fetch/fetchdata_test.go b/internal/fetch/fetchdata_test.go
index c3ee36b..e21e056 100644
--- a/internal/fetch/fetchdata_test.go
+++ b/internal/fetch/fetchdata_test.go
@@ -38,8 +38,6 @@
ModulePath: "github.com/basic",
HasGoMod: false,
},
- LegacyReadmeFilePath: "README.md",
- LegacyReadmeContents: "THIS IS A README",
},
Units: []*internal.Unit{
{
@@ -110,8 +108,6 @@
HasGoMod: true,
SourceInfo: source.NewGitHubInfo("https://github.com/my/module", "", "v1.0.0"),
},
- LegacyReadmeFilePath: "README.md",
- LegacyReadmeContents: "README FILE FOR TESTING.",
},
Units: []*internal.Unit{
{
@@ -389,8 +385,6 @@
ModulePath: "nonredistributable.mod/module",
HasGoMod: true,
},
- LegacyReadmeFilePath: "README.md",
- LegacyReadmeContents: "README FILE FOR TESTING.",
},
Units: []*internal.Unit{
{
@@ -615,8 +609,6 @@
ModulePath: "github.com/my/module/js",
SourceInfo: source.NewGitHubInfo("https://github.com/my/module", "js", "js/v1.0.0"),
},
- LegacyReadmeFilePath: "README.md",
- LegacyReadmeContents: "THIS IS A README",
},
Units: []*internal.Unit{
{
@@ -669,8 +661,6 @@
HasGoMod: true,
SourceInfo: source.NewGitHubInfo("https://github.com/golang/go", "src", "go1.12.5"),
},
- LegacyReadmeFilePath: "README.md",
- LegacyReadmeContents: "# The Go Programming Language\n",
},
Units: []*internal.Unit{
{