aboutsummaryrefslogtreecommitdiff
path: root/internal/fetchdatasource/fetchdatasource.go
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2023-08-09 13:27:44 -0400
committerMichael Matloob <matloob@golang.org>2023-08-10 19:39:58 +0000
commit82f79ed16e8817d22bbc99159489de9f1cf805ac (patch)
tree90efdee83af306889f072ea83068b61e3a35aeef /internal/fetchdatasource/fetchdatasource.go
parent17236d30855a86d83b4d373b702844f39c29c9b0 (diff)
downloadgo-x-pkgsite-82f79ed16e8817d22bbc99159489de9f1cf805ac.tar.xz
cmd/pkgsite: more changes to use local stdlib
This cl makes more changes to enable using the local stdlib. It always uses the local stdlib from cmd/pkgsite. It also changes code that processes and shows versions to expect and pass through v0.0.0, the fake version we use when we show local packages. For #57742 Change-Id: Ic407e58e9658b0703dbc6df47f40bbe1f1bd2b2a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/517915 kokoro-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'internal/fetchdatasource/fetchdatasource.go')
-rw-r--r--internal/fetchdatasource/fetchdatasource.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/internal/fetchdatasource/fetchdatasource.go b/internal/fetchdatasource/fetchdatasource.go
index 8f3e0ad0..8aef0a69 100644
--- a/internal/fetchdatasource/fetchdatasource.go
+++ b/internal/fetchdatasource/fetchdatasource.go
@@ -23,7 +23,6 @@ import (
"golang.org/x/pkgsite/internal/fetch"
"golang.org/x/pkgsite/internal/log"
"golang.org/x/pkgsite/internal/proxy"
- "golang.org/x/pkgsite/internal/stdlib"
"golang.org/x/pkgsite/internal/version"
)
@@ -166,15 +165,6 @@ func (ds *FetchDataSource) fetch(ctx context.Context, modulePath, version string
} else {
m.RemoveNonRedistributableData()
}
- // There is special handling in FetchModule for the standard library,
- // that bypasses the getter g. Don't record g as having fetch std.
- //
- // TODO(rfindley): it would be cleaner if the standard library could be
- // its own module getter. This could also allow the go/packages getter to
- // serve existing on-disk content for std. See also golang/go#58923.
- if modulePath == stdlib.ModulePath {
- g = nil
- }
return m, g, nil
}
if !errors.Is(fr.Error, derrors.NotFound) {
@@ -187,7 +177,7 @@ func (ds *FetchDataSource) fetch(ctx context.Context, modulePath, version string
func (ds *FetchDataSource) populateUnitSubdirectories(u *internal.Unit, m *internal.Module) {
p := u.Path + "/"
for _, u2 := range m.Units {
- if strings.HasPrefix(u2.Path, p) {
+ if strings.HasPrefix(u2.Path, p) || u.Path == "std" {
var syn string
if len(u2.Documentation) > 0 {
syn = u2.Documentation[0].Synopsis