diff options
| author | Jonathan Amsterdam <jba@google.com> | 2021-08-24 06:49:17 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2021-08-24 19:26:13 +0000 |
| commit | a26f4ee24cbb490825ea7363507387eec389d132 (patch) | |
| tree | 63f874d6ad93465118b97fea0604f85ec9489b6e /internal/testing/sample/sample.go | |
| parent | daea3ebe1e86d669ba2762a1f83ce4a5d15f8a12 (diff) | |
| download | go-x-pkgsite-a26f4ee24cbb490825ea7363507387eec389d132.tar.xz | |
internal/fetch: populate Unit.BuildContexts
Populate the lists of build contexts when fetching a module.
Currently we only do this when reading from the DB. We want
DataSources that rely only on fetch to have the right value.
For golang/go#47780
Change-Id: Ie85fba8ccb318bb4ed5c1f2153b0ba4216358022
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/344670
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/testing/sample/sample.go')
| -rw-r--r-- | internal/testing/sample/sample.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index 27fdad11..72d5c128 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -225,6 +225,7 @@ func UnitForPackage(path, modulePath, version, name string, isRedistributable bo return &internal.Unit{ UnitMeta: *UnitMeta(path, modulePath, version, name, isRedistributable), Documentation: []*internal.Documentation{&doc}, + BuildContexts: []internal.BuildContext{{GOOS: doc.GOOS, GOARCH: doc.GOARCH}}, LicenseContents: Licenses(), Imports: imps, NumImports: len(imps), |
