From 16ca4f2299153124ca2f996b94db92bc98fcebd1 Mon Sep 17 00:00:00 2001 From: Julie Qiu Date: Tue, 1 Sep 2020 18:52:12 -0400 Subject: 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 --- internal/postgres/insert_module_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/postgres/insert_module_test.go') diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go index fd74d67e..d5b717d6 100644 --- a/internal/postgres/insert_module_test.go +++ b/internal/postgres/insert_module_test.go @@ -161,7 +161,7 @@ func TestInsertModuleLicenseCheck(t *testing.T) { mod := sample.Module(sample.ModulePath, sample.VersionString, "") checkHasRedistData(mod.LegacyReadmeContents, mod.LegacyPackages[0].DocumentationHTML, true) - checkHasRedistData(mod.Units[0].Readme.Contents, mod.Units[0].Package.Documentation.HTML, true) + checkHasRedistData(mod.Units[0].Readme.Contents, mod.Units[0].Documentation.HTML, true) mod.IsRedistributable = false mod.LegacyPackages[0].IsRedistributable = false mod.Units[0].IsRedistributable = false @@ -187,17 +187,17 @@ func TestInsertModuleLicenseCheck(t *testing.T) { ModulePath: mod.ModulePath, Version: mod.Version, } - dir, err := db.GetUnit(ctx, pathInfo, internal.AllFields) + u, err := db.GetUnit(ctx, pathInfo, internal.AllFields) if err != nil { t.Fatal(err) } var readme string - if dir.Readme != nil { - readme = dir.Readme.Contents + if u.Readme != nil { + readme = u.Readme.Contents } var doc safehtml.HTML - if dir.Package != nil && dir.Package.Documentation != nil { - doc = dir.Package.Documentation.HTML + if u.Documentation != nil { + doc = u.Documentation.HTML } checkHasRedistData(readme, doc, bypass) }) -- cgit v1.3