internal/cmd/generate-protos: initial commit

Create a single binary for handling generation of protos.
This replaces previous logic spread throughout the repo in:
* regenerate.bash
* cmd/protoc-gen-go/golden_test.go
* cmd/protoc-gen-go-grpc/golden_test.go
* (indirectly) internal/protogen/goldentest

One of the problems with the former approaches is that they relied on
a version of protoc that was specific to a developer's workstation.
This meant that the result of generation was not hermetic.
To address this, we rely on the hard-coded version of protobuf specified
in the test.bash script.

A summary of changes in this CL are:
* The internal_gengo.GenerateFile and internal_gengogrpc.GenerateFile
functions are unified to have consistent signatures. It seems that the
former accepted a *protogen.GeneratedFile to support v1 where gRPC code
was generated into the same file as the base .pb.go file. However, the
same functionality can be achieved by having the function return
the generated file object.
* The test.bash script patches the protobuf toolchain to have properly
specified go_package options in each proto source file.
* The test.bash script accepts a "-regenerate" argument.
* Add generation for the well-known types. Contrary to how these were
laid out in the v1 repo, all the well-known types are placed in the
same Go package.
* Add generation for the conformance proto.
* Remove regenerate.bash
* Remove internal/protogen
* Remove cmd/protoc-gen-go/golden_test.go
* Remove cmd/protoc-gen-go-grpc/golden_test.go
* Add cmd/protoc-gen-go/annotation_test.go

Change-Id: I4a1a97ae6f66e2fabcf4e4d292c95ab2a2db0248
Reviewed-on: https://go-review.googlesource.com/c/164477
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/testprotos/legacy/legacy.proto b/internal/testprotos/legacy/legacy.proto
index c715edd..700fefe 100644
--- a/internal/testprotos/legacy/legacy.proto
+++ b/internal/testprotos/legacy/legacy.proto
@@ -18,12 +18,12 @@
 
 // The oldest supported version of protoc-gen-go is 2fc053c5,
 // which finished adding descriptor methods to all protobuf types.
-import "internal/testprotos/legacy/proto2.v0.0.0-20160225-2fc053c5/test.proto";
-import "internal/testprotos/legacy/proto3.v0.0.0-20160225-2fc053c5/test.proto";
+import "legacy/proto2.v0.0.0-20160225-2fc053c5/test.proto";
+import "legacy/proto3.v0.0.0-20160225-2fc053c5/test.proto";
 // Changes from 20160225 to 20160519:
 //	* Nothing noteworthy to generated code
-import "internal/testprotos/legacy/proto2.v0.0.0-20160519-a4ab9ec5/test.proto";
-import "internal/testprotos/legacy/proto3.v0.0.0-20160519-a4ab9ec5/test.proto";
+import "legacy/proto2.v0.0.0-20160519-a4ab9ec5/test.proto";
+import "legacy/proto3.v0.0.0-20160519-a4ab9ec5/test.proto";
 // Changes from 20160519 to 20180125:
 //	* Removed ExtensionMap method and XXX_extensions field from messages
 //	* Added embedded proto.XXX_InternalExtensions field to messages
@@ -31,8 +31,8 @@
 //	* Added registration for file descriptor
 //	* Added Get accessor methods for all fields in proto3 messages
 //	* Proto3 repeated primitives are packed by default
-import "internal/testprotos/legacy/proto2.v1.0.0-20180125-92554152/test.proto";
-import "internal/testprotos/legacy/proto3.v1.0.0-20180125-92554152/test.proto";
+import "legacy/proto2.v1.0.0-20180125-92554152/test.proto";
+import "legacy/proto3.v1.0.0-20180125-92554152/test.proto";
 // Changes from 20180125 to 20180430:
 //	* Added XXX_unrecognized field to proto3 messages
 //	* Added XXX_NoUnkeyedLiteral field to messages
@@ -44,17 +44,17 @@
 //	* Added XXX_DiscardUnknown method to messages
 //	* Added dependency on proto.InternalMessageInfo for table-driven logic
 //	* Added registration for map types
-import "internal/testprotos/legacy/proto2.v1.1.0-20180430-b4deda09/test.proto";
-import "internal/testprotos/legacy/proto3.v1.1.0-20180430-b4deda09/test.proto";
+import "legacy/proto2.v1.1.0-20180430-b4deda09/test.proto";
+import "legacy/proto3.v1.1.0-20180430-b4deda09/test.proto";
 // Changes from 20180430 to 20180814:
 //	* Added "proto3" struct tag to all fields in proto3 messages
-import "internal/testprotos/legacy/proto2.v1.2.0-20180814-aa810b61/test.proto";
-import "internal/testprotos/legacy/proto3.v1.2.0-20180814-aa810b61/test.proto";
+import "legacy/proto2.v1.2.0-20180814-aa810b61/test.proto";
+import "legacy/proto3.v1.2.0-20180814-aa810b61/test.proto";
 // Changes from 20180814 to 20181126:
 //	* Changed the XXX_OneofFuncs method to XXX_OneofWrappers
 //	* Various syntactical changes to make the output more consistent
-import "internal/testprotos/legacy/proto2.v1.2.1-20181126-8d0c54c1/test.proto";
-import "internal/testprotos/legacy/proto3.v1.2.1-20181126-8d0c54c1/test.proto";
+import "legacy/proto2.v1.2.1-20181126-8d0c54c1/test.proto";
+import "legacy/proto3.v1.2.1-20181126-8d0c54c1/test.proto";
 
 message Legacy {
 	google.golang.org.proto2_20160225.Message f1 = 1;