diff options
| author | Julie Qiu <julie@golang.org> | 2020-08-31 23:25:42 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-09-01 14:32:55 +0000 |
| commit | b47aad8790a3780b9e7979e5f94c01da0d7bb100 (patch) | |
| tree | d0e5bd5f01a5b185472f0bece391ab796da75aa2 /internal/testing/sample/sample.go | |
| parent | 0dbaeaf4674211c66175ad1bbf728ad69b5cee42 (diff) | |
| download | go-x-pkgsite-b47aad8790a3780b9e7979e5f94c01da0d7bb100.tar.xz | |
internal/postgres: add data to PathInfo
The following fields are added to GetPathInfo:
- CommitTime
- License metadata
- RepositoryURL
- PackageSourceURL
For golang/go#39629
Change-Id: I664a0e96647ae2ad2404631e27f714b64db5c79c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/251919
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 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index ea2d21bc..bb519696 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -300,6 +300,18 @@ func UnitForPackage(pkg *internal.LegacyPackage) *internal.Unit { } } +func PathInfo(path, modulePath, version, name string, isRedistributable bool) *internal.PathInfo { + return &internal.PathInfo{ + ModulePath: modulePath, + Version: version, + Path: path, + Name: name, + IsRedistributable: isRedistributable, + Licenses: LicenseMetadata, + SourceInfo: source.NewGitHubInfo("https://"+modulePath, "", version), + } +} + func fullPath(modulePath, suffix string) string { if modulePath != stdlib.ModulePath { return path.Join(modulePath, suffix) |
