aboutsummaryrefslogtreecommitdiff
path: root/internal/fetchdatasource/fetchdatasource_test.go
diff options
context:
space:
mode:
authorEthan Lee <ethanalee@google.com>2026-03-18 18:44:04 +0000
committerGopher Robot <gobot@golang.org>2026-03-20 10:16:35 -0700
commit09023703e191c710c472865870494ff3c20513ce (patch)
tree68728be548a46859a638bf1ebe3f3b10d6f280fe /internal/fetchdatasource/fetchdatasource_test.go
parentab4b6a99d7828154fc803870bbb2f18835d6470b (diff)
downloadgo-x-pkgsite-09023703e191c710c472865870494ff3c20513ce.tar.xz
internal: conditionally return documentation in GetUnit
- Large documentations blobs should avoid being returned unless explicitly requested. Add a WithDocsSource to enable retrieval of unit information without the large documentation source information. - This does not functionally change existing GetUnit callsites. Change-Id: Ie983b7eaeb61bb92f2716ae64a3d1e1ea738dbe2 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/756480 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'internal/fetchdatasource/fetchdatasource_test.go')
-rw-r--r--internal/fetchdatasource/fetchdatasource_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/fetchdatasource/fetchdatasource_test.go b/internal/fetchdatasource/fetchdatasource_test.go
index 05cb121a..223c38bd 100644
--- a/internal/fetchdatasource/fetchdatasource_test.go
+++ b/internal/fetchdatasource/fetchdatasource_test.go
@@ -227,7 +227,7 @@ func TestBypass(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- got, err := ds.GetUnit(ctx, um, 0, internal.BuildContext{})
+ got, err := ds.GetUnit(ctx, um, internal.WithDocsSource, internal.BuildContext{})
if err != nil {
t.Fatal(err)
}
@@ -495,7 +495,7 @@ func TestGetUnit(t *testing.T) {
Path: test.path,
ModuleInfo: internal.ModuleInfo{ModulePath: test.modulePath},
}
- got, err := ds.GetUnit(ctx, um, 0, internal.BuildContext{})
+ got, err := ds.GetUnit(ctx, um, internal.WithDocsSource, internal.BuildContext{})
if !test.wantLoaded {
if err == nil {
t.Fatal("returned not loaded module")