internal/cmd/generate-protos: disable detrand

The .pb.go.meta file is checked into the repository as testdata.
The deliberate instability of outputs breaks golden tests within
our own repository. It is reasonable for us to depend on stability
since we control the output.

Change-Id: I1f73027a08a0757732d46610f334d40840cc4cfd
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/168001
Reviewed-by: Herbie Ong <herbie@google.com>
diff --git a/internal/cmd/generate-protos/main.go b/internal/cmd/generate-protos/main.go
index d9f3aea..c2bbac3 100644
--- a/internal/cmd/generate-protos/main.go
+++ b/internal/cmd/generate-protos/main.go
@@ -21,6 +21,7 @@
 
 	gengogrpc "github.com/golang/protobuf/v2/cmd/protoc-gen-go-grpc/internal_gengogrpc"
 	gengo "github.com/golang/protobuf/v2/cmd/protoc-gen-go/internal_gengo"
+	"github.com/golang/protobuf/v2/internal/detrand"
 	"github.com/golang/protobuf/v2/protogen"
 	"github.com/golang/protobuf/v2/reflect/protoreflect"
 )
@@ -30,6 +31,10 @@
 	// we skip running main and instead act as a protoc plugin.
 	// This allows the binary to pass itself to protoc.
 	if plugins := os.Getenv("RUN_AS_PROTOC_PLUGIN"); plugins != "" {
+		// Disable deliberate output instability for generated files.
+		// This is reasonable since we fully control the output.
+		detrand.Disable()
+
 		protogen.Run(nil, func(gen *protogen.Plugin) error {
 			for _, plugin := range strings.Split(plugins, ",") {
 				for _, file := range gen.Files {