There's no good reason to exclude it and it only makes the code more
complicated and less consistent. Having it in the list provides an
easy way to detect if a package uses operations from package unsafe.
Change-Id: I2f9b0485db0a680bd82f3b93a350b048db3f7701
Reviewed-on: https://go-review.googlesource.com/37694
Reviewed-by: Alan Donovan <adonovan@google.com>
func (pkg *Package) MarkComplete() { pkg.complete = true }
// Imports returns the list of packages directly imported by
-// pkg; the list is in source order. Package unsafe is excluded.
+// pkg; the list is in source order.
//
// If pkg was loaded from export data, Imports includes packages that
// provide package-level objects referenced by pkg. This may be more or
// for clients; it is not needed for type-checking)
if !pkgImports[imp] {
pkgImports[imp] = true
- if imp != Unsafe {
- pkg.imports = append(pkg.imports, imp)
- }
+ pkg.imports = append(pkg.imports, imp)
}
// local name overrides imported package name