cmd/gobind: load from export data, not source

Replace the vendored version of x/tools/go/loader with the standard
library's go/importer package. This reads the export data from
$GOPATH/pkg/pkgname.a instead of parsing and type checking the source
code. The "go install" subcommand is invoked just prior to reading the
export data to make sure the export data is up to date.

This has the advantage of relying entirely on the go tool for correctly
resolving and parsing dependencies of the package being bound. (For
example, a bound package can now depend on cgo.) It also removes a class
of bugs where the version of the loader we depend on can get out of sync
with the go tool. (For example, gobind now correctly handles vendor
dependencies.)

As a bonus, for packages with significant dependencies this approach
should also be noticeably faster as we do not need to parse and
typecheck all of the dependencies.

Change-Id: If9a431c137eae2071c1d89be88a4a6a61d6812fa
Reviewed-on: https://go-review.googlesource.com/16911
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2 files changed
tree: f9fbd557e68e856ecb08923b65e15af9d341c85d
  1. app/
  2. asset/
  3. bind/
  4. cmd/
  5. doc/
  6. event/
  7. example/
  8. exp/
  9. geom/
  10. gl/
  11. internal/
  12. misc/
  13. testdata/
  14. .gitattributes
  15. .gitignore
  16. AUTHORS
  17. codereview.cfg
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. LICENSE
  21. PATENTS
  22. README.md
README.md

Go support for Mobile devices

The Go mobile repository holds packages and build tools for using Go on mobile platforms.

Package documentation as a starting point:

Caution image

The Go Mobile project is experimental. Use this at your own risk. While we are working hard to improve it, neither Google nor the Go team can provide end-user support.

This is early work and installing the build system requires Go 1.5. Follow the instructions on golang.org/wiki/Mobile to install the gomobile command, build the basic and the bind example apps.


Contributions to Go are appreciated. See https://golang.org/doc/contribute.html.