diff options
| author | Julie Qiu <julie@golang.org> | 2020-10-25 21:46:17 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-10-26 13:03:05 +0000 |
| commit | c4e44bdaacbd99881378c8b055ee9031f182484f (patch) | |
| tree | 9d8a22ab07ba389ba3cc7fcc687981c1ef3ee9ce /internal/testing/sample/sample.go | |
| parent | 013c7f06492c1e6f4fadd608144ee638b4601d34 (diff) | |
| download | go-x-pkgsite-c4e44bdaacbd99881378c8b055ee9031f182484f.tar.xz | |
internal/testing/sample: deprecate legacyUnitForPackage
legacyUnitForPackage is deprecated in favor of UnitForPackage.
legacyUnitForModuleRoot is also renamed to UnitForModuleRoot.
For golang/go#39629
Change-Id: I73f781e570552656262f9982bb2a018937598306
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/265002
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/testing/sample/sample.go')
| -rw-r--r-- | internal/testing/sample/sample.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index 5cd47938..45b3e88a 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -100,22 +100,17 @@ func NowTruncated() time.Time { // is the concatenation of modulePath and suffix. // // The package name is last component of the package path. -func UnitForPackage(modulePath, suffix string) *internal.Unit { - p := constructFullPath(modulePath, suffix) +func UnitForPackage(path, modulePath, version, name string, isRedistributable bool) *internal.Unit { return &internal.Unit{ - UnitMeta: internal.UnitMeta{ - Name: path.Base(p), - Path: p, - IsRedistributable: true, - Licenses: LicenseMetadata, - }, + UnitMeta: *UnitMeta(path, modulePath, version, name, isRedistributable), Documentation: &internal.Documentation{ Synopsis: Synopsis, HTML: DocumentationHTML, GOOS: GOOS, GOARCH: GOARCH, }, - Imports: Imports, + LicenseContents: Licenses, + Imports: Imports, } } |
