aboutsummaryrefslogtreecommitdiff
path: root/internal/stdlib/stdlib.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2021-02-26 13:16:21 -0500
committerJulie Qiu <julie@golang.org>2021-03-01 16:58:54 +0000
commit7e7858473f8e9ff87873cd445a7403181346f6db (patch)
tree994e2cb4f290ce457c14e60bb6621af3c6e50e8f /internal/stdlib/stdlib.go
parent17f3cfb711f246930a1ef6a40591ea1965c093b6 (diff)
downloadgo-x-pkgsite-7e7858473f8e9ff87873cd445a7403181346f6db.tar.xz
internal: do not display README at /std
The README is no longer displayed at pkg.go.dev/std. It is also no longer stored in the database when a std module is fetched. For golang/go#44356 Change-Id: I6b1605389bc3c97694b6ec2b06e28006a38be999 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296950 Trust: Julie Qiu <julie@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/stdlib/stdlib.go')
-rw-r--r--internal/stdlib/stdlib.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/stdlib/stdlib.go b/internal/stdlib/stdlib.go
index fef4f6cd..4a251b71 100644
--- a/internal/stdlib/stdlib.go
+++ b/internal/stdlib/stdlib.go
@@ -425,15 +425,17 @@ func addFiles(z *zip.Writer, r *git.Repository, t *object.Tree, dirpath string,
// ignore; we'll synthesize our own
continue
}
- if e.Name == "README.vendor" && !strings.Contains(dirpath, "/") {
+ if strings.HasPrefix(e.Name, "README") && !strings.Contains(dirpath, "/") {
// For versions newer than v1.4.0-beta.1, the stdlib is in src/pkg.
// This means that our construction of the zip files will return
// two READMEs at the root:
// https://golang.org/README.md and
// https://golang.org/src/README.vendor
- // We only want to display the README.md, so ignore README.vendor.
- // However, we do want to store the README.vendor in
- // std@<version>/cmd.
+ //
+ // We do not want to display the README.md
+ // or any README.vendor.
+ // However, we do want to store the README in
+ // other directories.
continue
}
switch e.Mode {