diff options
| author | Julie Qiu <julie@golang.org> | 2020-09-01 18:52:12 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-09-02 16:45:25 +0000 |
| commit | 16ca4f2299153124ca2f996b94db92bc98fcebd1 (patch) | |
| tree | 798a3073849cb63b6ac5391b7900a4a1b6dd57df /internal/testing/sample/sample.go | |
| parent | afffc195e7586c235e41479ad391babe4f2edb05 (diff) | |
| download | go-x-pkgsite-16ca4f2299153124ca2f996b94db92bc98fcebd1.tar.xz | |
internal: move Unit.Package.Documentation to Unit.Documentation
The Documentation field is moved from Unit.Package.Documentation to
Unit.Documentation. Unit.Package will be deprecated in a later CL.
For golang/go#39629
Change-Id: Idc6d6598a2647a55b55c947120c322fec5da59cc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/252321
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/testing/sample/sample.go')
| -rw-r--r-- | internal/testing/sample/sample.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index 1096093d..f19c3f08 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -198,7 +198,9 @@ func Module(modulePath, version string, suffixes ...string) *internal.Module { AddPackage(m, lp) } else { m.LegacyPackages = append(m.LegacyPackages, lp) - m.Units[0].Package = UnitForPackage(lp, modulePath, version).Package + u := UnitForPackage(lp, modulePath, version) + m.Units[0].Package = u.Package + m.Units[0].Documentation = u.Documentation } } return m @@ -277,15 +279,15 @@ func UnitForPackage(pkg *internal.LegacyPackage, modulePath, version string) *in UnitMeta: *UnitMeta(pkg.Path, modulePath, version, pkg.Name, pkg.IsRedistributable), Imports: pkg.Imports, LicenseContents: Licenses, + Documentation: &internal.Documentation{ + Synopsis: pkg.Synopsis, + HTML: pkg.DocumentationHTML, + GOOS: pkg.GOOS, + GOARCH: pkg.GOARCH, + }, Package: &internal.Package{ Name: pkg.Name, Path: pkg.Path, - Documentation: &internal.Documentation{ - Synopsis: pkg.Synopsis, - HTML: pkg.DocumentationHTML, - GOOS: pkg.GOOS, - GOARCH: pkg.GOARCH, - }, }, } } |
