diff options
| author | Michael Matloob <matloob@golang.org> | 2024-01-17 14:10:26 -0500 |
|---|---|---|
| committer | Michael Matloob <matloob@golang.org> | 2024-01-23 15:28:52 +0000 |
| commit | c7eaeb891e256eea9575c5d1a33c3458161db86f (patch) | |
| tree | cdde74bda5f4833f600fe1cd36cd5c5ad23b7cac /internal/fetchdatasource | |
| parent | 506adfeab1ce4a0423fcfd861f0fb728202831a8 (diff) | |
| download | go-x-pkgsite-c7eaeb891e256eea9575c5d1a33c3458161db86f.tar.xz | |
internal: move UnitMeta.IsRedistributable to Unit
Change-Id: Ia0a18df32d752f20b0400b47860638c7d0910eb7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/556435
Reviewed-by: Jonathan Amsterdam <jba@google.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'internal/fetchdatasource')
| -rw-r--r-- | internal/fetchdatasource/fetchdatasource.go | 1 | ||||
| -rw-r--r-- | internal/fetchdatasource/fetchdatasource_test.go | 24 |
2 files changed, 8 insertions, 17 deletions
diff --git a/internal/fetchdatasource/fetchdatasource.go b/internal/fetchdatasource/fetchdatasource.go index 88ab1382..f8ae0d25 100644 --- a/internal/fetchdatasource/fetchdatasource.go +++ b/internal/fetchdatasource/fetchdatasource.go @@ -227,7 +227,6 @@ func (ds *FetchDataSource) GetUnitMeta(ctx context.Context, path, requestedModul return nil, derrors.NotFound } um.Name = u.Name - um.IsRedistributable = u.IsRedistributable return um, nil } diff --git a/internal/fetchdatasource/fetchdatasource_test.go b/internal/fetchdatasource/fetchdatasource_test.go index ae14bf60..53bca653 100644 --- a/internal/fetchdatasource/fetchdatasource_test.go +++ b/internal/fetchdatasource/fetchdatasource_test.go @@ -159,8 +159,7 @@ func TestProxyGetUnitMeta(t *testing.T) { modulePath: "example.com/single", version: "v1.0.0", want: &internal.UnitMeta{ - ModuleInfo: singleModInfo, - IsRedistributable: true, + ModuleInfo: singleModInfo, }, }, { @@ -168,9 +167,8 @@ func TestProxyGetUnitMeta(t *testing.T) { modulePath: "example.com/single", version: "v1.0.0", want: &internal.UnitMeta{ - ModuleInfo: singleModInfo, - Name: "pkg", - IsRedistributable: true, + ModuleInfo: singleModInfo, + Name: "pkg", }, }, { @@ -178,9 +176,8 @@ func TestProxyGetUnitMeta(t *testing.T) { modulePath: internal.UnknownModulePath, version: "v1.0.0", want: &internal.UnitMeta{ - ModuleInfo: singleModInfo, - Name: "pkg", - IsRedistributable: true, + ModuleInfo: singleModInfo, + Name: "pkg", }, }, { @@ -195,8 +192,7 @@ func TestProxyGetUnitMeta(t *testing.T) { CommitTime: proxytest.CommitTime, HasGoMod: true, }, - Name: "basic", - IsRedistributable: true, + Name: "basic", }, }, } { @@ -358,7 +354,6 @@ func TestLocalGetUnitMeta(t *testing.T) { HasGoMod: true, SourceInfo: sourceInfo, }, - IsRedistributable: true, }, }, { @@ -374,7 +369,6 @@ func TestLocalGetUnitMeta(t *testing.T) { HasGoMod: true, SourceInfo: sourceInfo, }, - IsRedistributable: true, }, }, { @@ -390,16 +384,14 @@ func TestLocalGetUnitMeta(t *testing.T) { HasGoMod: true, SourceInfo: sourceInfo, }, - IsRedistributable: true, }, }, { path: "github.com/my/module/bar", modulePath: internal.UnknownModulePath, want: &internal.UnitMeta{ - Path: "github.com/my/module/bar", - Name: "bar", - IsRedistributable: true, + Path: "github.com/my/module/bar", + Name: "bar", ModuleInfo: internal.ModuleInfo{ ModulePath: "github.com/my/module", Version: fetch.LocalVersion, |
