diff options
| author | Julie Qiu <julie@golang.org> | 2020-09-01 22:40:52 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-09-02 16:46:14 +0000 |
| commit | d0a182d328c2ca96a505dcafe29f197526d897a4 (patch) | |
| tree | 50fa885931506afacfd8fb9a470ee7d68af7b6d6 /internal/postgres/insert_module.go | |
| parent | 16ca4f2299153124ca2f996b94db92bc98fcebd1 (diff) | |
| download | go-x-pkgsite-d0a182d328c2ca96a505dcafe29f197526d897a4.tar.xz | |
internal: remove Unit.Package
Unit.Pacakge is removed, since it isn't need for anything.
For golang/go#39629
Change-Id: Ic620603550874de8a0b4c37c67a88bee65ec7933
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/252323
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/postgres/insert_module.go')
| -rw-r--r-- | internal/postgres/insert_module.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go index bcfabf06..2db1695f 100644 --- a/internal/postgres/insert_module.go +++ b/internal/postgres/insert_module.go @@ -385,10 +385,8 @@ func insertUnits(ctx context.Context, db *database.DB, m *internal.Module, modul sort.Slice(m.Units, func(i, j int) bool { return m.Units[i].Path < m.Units[j].Path }) - for _, d := range m.Units { - if d.Package != nil && len(d.Imports) > 1 { - sort.Strings(d.Imports) - } + for _, u := range m.Units { + sort.Strings(u.Imports) } var ( pathValues []interface{} @@ -415,15 +413,11 @@ func insertUnits(ctx context.Context, db *database.DB, m *internal.Module, modul } } } - var name string - if d.Package != nil { - name = d.Package.Name - } pathValues = append(pathValues, d.Path, moduleID, internal.V1Path(d.Path, m.ModulePath), - name, + d.Name, pq.Array(licenseTypes), pq.Array(licensePaths), d.IsRedistributable, |
