зеркало из https://github.com/golang/tools.git
go/ssa: sanity check for package transient fields
Change-Id: I96badb1a6c4f3737a30e3a5fc5c458a1a64264bf
GitHub-Last-Rev: 9a332833af
GitHub-Pull-Request: golang/tools#519
Reviewed-on: https://go-review.googlesource.com/c/tools/+/613158
Commit-Queue: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Родитель
2aabc4f384
Коммит
03550136e7
|
@ -609,6 +609,19 @@ func sanityCheckPackage(pkg *Package) {
|
|||
if pkg.Pkg == nil {
|
||||
panic(fmt.Sprintf("Package %s has no Object", pkg))
|
||||
}
|
||||
if pkg.info != nil {
|
||||
panic(fmt.Sprintf("package %s field 'info' is not cleared", pkg))
|
||||
}
|
||||
if pkg.files != nil {
|
||||
panic(fmt.Sprintf("package %s field 'files' is not cleared", pkg))
|
||||
}
|
||||
if pkg.created != nil {
|
||||
panic(fmt.Sprintf("package %s field 'created' is not cleared", pkg))
|
||||
}
|
||||
if pkg.initVersion != nil {
|
||||
panic(fmt.Sprintf("package %s field 'initVersion' is not cleared", pkg))
|
||||
}
|
||||
|
||||
_ = pkg.String() // must not crash
|
||||
|
||||
for name, mem := range pkg.Members {
|
||||
|
|
Загрузка…
Ссылка в новой задаче