[fidl][golang] Regenerate fidlgen code

Instructions:

To update all the saved fidlgen files, first get a list of all the files made by fidlgen ignoring those in the out directory:

rg "generated by fidlgen" . | rg -v ./out

I found these (ignoring the templates in garnet):

./third_party/go/src/syscall/zx/net/impl.go:// WARNING: This file is machine generated by fidlgen.
./third_party/go/src/syscall/zx/io/impl.go:// WARNING: This file is machine generated by fidlgen.
./third_party/go/src/syscall/zx/fidl/bindingstest/impl.go:// WARNING: This file is machine generated by fidlgen.

Now build and replace them:

./out/x64/host_x64/fidlc --json foo.json --files third_party/go/src/syscall/zx/fidl/bindingstest/test.fidl
./out/x64/host_x64/fidlgen -generators go -include-base foo --output-base bar -json foo.json
cp bar/impl.go third_party/go/src/syscall/zx/fidl/bindingstest/impl.go

./out/x64/host_x64/fidlc --json foo.json --files zircon/system/fidl/fuchsia-net/*.fidl
./out/x64/host_x64/fidlgen -generators go -include-base foo --output-base bar -json foo.json
cp bar/impl.go third_party/go/src/syscall/zx/net/impl.go

./out/x64/host_x64/fidlc --json foo.json --files zircon/system/fidl/fuchsia-io/io.fidl
./out/x64/host_x64/fidlgen -generators go -include-base foo --output-base bar -json foo.json
cp bar/impl.go third_party/go/src/syscall/zx/io/impl.go

Now `git diff -w` and look for comments that you need to adjust to fix up those files.  Stuff like adding "+build fuchsia"

.../io/impl.go is especially ugly because lot sof "int32" need to be changed to "_zx.Socket".  Use your favorite regexp replace tool:

sed -i -E "s/S\s+int32/S _zx.Status/" syscall/zx/io/impl.go
sed -i -E "s/\)\s+\(int32/\) \(_zx.Status/" syscall/zx/io/impl.go

To see if you got them all, run this command and look for "_zx.Status" in the output:

git diff -w -U0 master

TESTED=fx run-test go_fidl_test

I found a few OnOpen functions.

Change-Id: I79ae80294118af1d2280b87b8e2f53211931dba8
4 files changed
tree: ed3d9e6beeb11c4441e0fb35ae3712af67f0eec5
  1. .github/
  2. api/
  3. doc/
  4. lib/
  5. misc/
  6. src/
  7. test/
  8. .gitattributes
  9. .gitignore
  10. AUTHORS
  11. BUILD.gn
  12. CONTRIBUTING.md
  13. CONTRIBUTORS
  14. favicon.ico
  15. LICENSE
  16. makefuchsia.go
  17. makeroot.go
  18. PATENTS
  19. README.md
  20. robots.txt
  21. VERSION
README.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.