internal: delete LegacyPackage

For golang/go#39629

Change-Id: Ie79750dfd94cec05078b2122ec99e6aa59e75b2e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/265004
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Julie Qiu 2020-10-25 21:58:01 -04:00
Родитель 4cc0821bb2
Коммит 074edda765
3 изменённых файлов: 0 добавлений и 64 удалений

Просмотреть файл

@ -1,30 +0,0 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package internal
import (
"github.com/google/safehtml"
"golang.org/x/pkgsite/internal/licenses"
)
// A LegacyPackage is a group of one or more Go source files with the same
// package header.
type LegacyPackage struct {
Path string
Name string
Synopsis string
IsRedistributable bool
Licenses []*licenses.Metadata // metadata of applicable licenses
Imports []string
DocumentationHTML safehtml.HTML
// The values of the GOOS and GOARCH environment variables used to parse the
// package.
GOOS string
GOARCH string
// V1Path is the package path of a package with major version 1 in a given
// series.
V1Path string
}

Просмотреть файл

@ -7,10 +7,6 @@
package internal
import (
"github.com/google/safehtml"
)
func (m *Module) RemoveNonRedistributableData() {
for _, l := range m.Licenses {
l.RemoveNonRedistributableData()
@ -32,10 +28,3 @@ func (p *PackageMeta) RemoveNonRedistributableData() {
p.Synopsis = ""
}
}
func (p *LegacyPackage) RemoveNonRedistributableData() {
if !p.IsRedistributable {
p.Synopsis = ""
p.DocumentationHTML = safehtml.HTML{}
}
}

Просмотреть файл

@ -12,29 +12,6 @@ import (
"golang.org/x/pkgsite/internal"
)
// LegacyPackage constructs a package with the given module path and suffix.
//
// If modulePath is the standard library, the package path is the
// suffix, which must not be empty. Otherwise, the package path
// is the concatenation of modulePath and suffix.
//
// The package name is last component of the package path.
func LegacyPackage(modulePath, suffix string) *internal.LegacyPackage {
p := constructFullPath(modulePath, suffix)
return &internal.LegacyPackage{
Name: path.Base(p),
Path: p,
V1Path: internal.V1Path(p, modulePath),
Synopsis: Synopsis,
IsRedistributable: true,
Licenses: LicenseMetadata,
DocumentationHTML: DocumentationHTML,
Imports: Imports,
GOOS: GOOS,
GOARCH: GOARCH,
}
}
func LegacyDefaultModule() *internal.Module {
fp := constructFullPath(ModulePath, Suffix)
return AddPackage(LegacyModule(ModulePath, VersionString), UnitForPackage(fp, ModulePath, VersionString, path.Base(fp), true))