diff options
| author | Jonathan Amsterdam <jba@google.com> | 2020-05-18 15:36:12 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2020-05-18 21:26:12 +0000 |
| commit | ecc8a1931eb2227af7ade55e530884188dcab0bb (patch) | |
| tree | 60ad849f82b45a4ccc37833274e74a90d816c2cd /internal/testing/sample/sample.go | |
| parent | 5a8a5611708d420ab9ffe0d456a544315a73fe71 (diff) | |
| download | go-x-pkgsite-ecc8a1931eb2227af7ade55e530884188dcab0bb.tar.xz | |
internal/sample: fix SourceInfo
Construct the sample SourceInfo from the given module path, not
the global one.
Change-Id: I2d61d0b234c591a2a6fb03bfbf329549cc0df507
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/750122
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Diffstat (limited to 'internal/testing/sample/sample.go')
| -rw-r--r-- | internal/testing/sample/sample.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index e25ecf78..55552651 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -119,13 +119,14 @@ func ModuleInfo(modulePath, versionString string) *internal.ModuleInfo { // ModuleInfos with "latest" for version, which should not be valid. func ModuleInfoReleaseType(modulePath, versionString string) *internal.ModuleInfo { return &internal.ModuleInfo{ - ModulePath: modulePath, - Version: versionString, - ReadmeFilePath: ReadmeFilePath, - ReadmeContents: ReadmeContents, - CommitTime: CommitTime, - VersionType: version.TypeRelease, - SourceInfo: source.NewGitHubInfo(RepositoryURL, "", ""), + ModulePath: modulePath, + Version: versionString, + ReadmeFilePath: ReadmeFilePath, + ReadmeContents: ReadmeContents, + CommitTime: CommitTime, + VersionType: version.TypeRelease, + // Assume the module path is a GitHub-like repo name. + SourceInfo: source.NewGitHubInfo("https://"+modulePath, "", versionString), IsRedistributable: true, HasGoMod: true, } |
