aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2020-09-01 18:52:12 -0400
committerJulie Qiu <julie@golang.org>2020-09-02 16:45:25 +0000
commit16ca4f2299153124ca2f996b94db92bc98fcebd1 (patch)
tree798a3073849cb63b6ac5391b7900a4a1b6dd57df /internal/postgres/insert_module.go
parentafffc195e7586c235e41479ad391babe4f2edb05 (diff)
downloadgo-x-pkgsite-16ca4f2299153124ca2f996b94db92bc98fcebd1.tar.xz
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 <jba@google.com>
Diffstat (limited to 'internal/postgres/insert_module.go')
-rw-r--r--internal/postgres/insert_module.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index 40bcf822..bcfabf06 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -431,14 +431,12 @@ func insertUnits(ctx context.Context, db *database.DB, m *internal.Module, modul
if d.Readme != nil {
pathToReadme[d.Path] = d.Readme
}
- if d.Package != nil {
- if d.Package.Documentation != nil && d.Package.Documentation.HTML.String() == internal.StringFieldMissing {
- return errors.New("saveModule: package missing Documentation.HTML")
- }
- pathToDoc[d.Path] = d.Package.Documentation
- if len(d.Imports) > 0 {
- pathToImports[d.Path] = d.Imports
- }
+ if d.Documentation != nil && d.Documentation.HTML.String() == internal.StringFieldMissing {
+ return errors.New("saveModule: package missing Documentation.HTML")
+ }
+ pathToDoc[d.Path] = d.Documentation
+ if len(d.Imports) > 0 {
+ pathToImports[d.Path] = d.Imports
}
}