From 814534999dcbf4fa3d7b358a6de57bf2d44fc450 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Fri, 29 Jan 2021 18:44:53 -0500 Subject: many: allow for multiple documentations for a Unit Change internal.Unit.Documentation from a single internal.Documentation to a slice, so that a Unit can have doc for multiple build contexts. However, don't use this ability yet: fetch takes only the first build context it finds, postgres inserts only the first, frontend renders only the first, etc. For golang/go#37232 Change-Id: I17fd1ff2378e0862c029c8077057c207001f6136 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288217 Trust: Jonathan Amsterdam Run-TryBot: Jonathan Amsterdam TryBot-Result: kokoro Reviewed-by: Julie Qiu Reviewed-by: Jamal Carvalho --- internal/postgres/insert_module_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 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 b290af58..617e7754 100644 --- a/internal/postgres/insert_module_test.go +++ b/internal/postgres/insert_module_test.go @@ -129,7 +129,7 @@ func TestInsertModuleLicenseCheck(t *testing.T) { } mod := sample.Module(sample.ModulePath, sample.VersionString, "") - checkHasRedistData(mod.Units[0].Readme.Contents, mod.Units[0].Documentation.Source, true) + checkHasRedistData(mod.Units[0].Readme.Contents, mod.Units[0].Documentation[0].Source, true) mod.IsRedistributable = false mod.Units[0].IsRedistributable = false @@ -155,7 +155,7 @@ func TestInsertModuleLicenseCheck(t *testing.T) { readme = u.Readme.Contents } if u.Documentation != nil { - source = u.Documentation.Source + source = u.Documentation[0].Source } checkHasRedistData(readme, source, bypass) }) -- cgit v1.3