go/types: remove invalid documentation and assertion on package names
NewPackage required through documentation that the package name not be blank (which wasn't true since each time we check a new package we create one with a blank name (api.go:350). NewPackage also asserted that a package name not be "_". While it is invalid for a package name to be "_", one could conceivably create a package named "_" through export data manipulation. Furthermore, it is ok to import a package with package path "_" as long as the package itself is not named "_". - removed misleading documentation - removed unnecessary assertion - added safety checks when we actually do the import Fixes #20231. Change-Id: I1eb1ab7b5e3130283db715374770cf05d749d159 Reviewed-on: https://go-review.googlesource.com/42852 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
Showing
Please
register
or
sign in
to comment