apidiff: refactor the first two pass for package checking

old:           new:
type A = B     type A B
type B int     type B int

The existence of the two for loop is to prevent type match
accidentally unalias the old A as B and map the old B to
the new A.

So the first loop will strictly perform exact name match
on exported non-alias type, i.e. when apidiff find a non-alias
type X, find the X in the new package.

(This first loop make sure the Unalias will be no op inside
of the checkObjects.)

Then the second loop can safely assume the name matches are
all found and loop over the rest of the exported type.

Change-Id: I6fadc2c1543da5600a89a22585344feda4ab505d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/847525
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Hongxiang Jiang <hxjiang@golang.org>
1 file changed
tree: e02c41adb7894e40c4e837552937813d184cce57
  1. apidiff/
  2. cmd/
  3. constraints/
  4. ebnf/
  5. ebnflint/
  6. errors/
  7. eval/
  8. event/
  9. inotify/
  10. io/
  11. jsonrpc2/
  12. maps/
  13. mmap/
  14. rand/
  15. shiny/
  16. shootout/
  17. slices/
  18. slog/
  19. stats/
  20. trace/
  21. typeparams/
  22. utf8string/
  23. .gitattributes
  24. .gitignore
  25. codereview.cfg
  26. CONTRIBUTING.md
  27. go.mod
  28. go.sum
  29. LICENSE
  30. PATENTS
  31. README.md
README.md

exp

PkgGoDev

This subrepository holds experimental and deprecated (in the old directory) packages.

The idea for this subrepository originated as the pkg/exp directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get these packages.

Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.

In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)

Caveat emptor.