cmd/protoc-gen-go: use protoapi.CompressGZIP

Calling a helper function directly should reduce binary bloat slightly.

Change-Id: I6068dc4cd00c8d90d2e6e6d99633b81388bc8781
Reviewed-on: https://go-review.googlesource.com/c/164679
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go
index d039c07..0d35481 100644
--- a/internal/testprotos/test/test.pb.go
+++ b/internal/testprotos/test/test.pb.go
@@ -4,9 +4,8 @@
 package test
 
 import (
-	bytes "bytes"
-	gzip "compress/gzip"
 	proto "github.com/golang/protobuf/proto"
+	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
@@ -2734,13 +2733,7 @@
 	0x73, 0x74, 0x50, 0x01, 0x58, 0x02,
 }
 
-var fileDescriptor_c161fcfdc0c3ff1e_gzipped = func() []byte {
-	bb := new(bytes.Buffer)
-	zw, _ := gzip.NewWriterLevel(bb, gzip.NoCompression)
-	zw.Write(fileDescriptor_c161fcfdc0c3ff1e)
-	zw.Close()
-	return bb.Bytes()
-}()
+var fileDescriptor_c161fcfdc0c3ff1e_gzipped = protoapi.CompressGZIP(fileDescriptor_c161fcfdc0c3ff1e)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/test_import.pb.go b/internal/testprotos/test/test_import.pb.go
index c896f84..c0f25b3 100644
--- a/internal/testprotos/test/test_import.pb.go
+++ b/internal/testprotos/test/test_import.pb.go
@@ -4,9 +4,8 @@
 package test
 
 import (
-	bytes "bytes"
-	gzip "compress/gzip"
 	proto "github.com/golang/protobuf/proto"
+	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
@@ -116,13 +115,7 @@
 	0x74,
 }
 
-var fileDescriptor_89be98e26346f54e_gzipped = func() []byte {
-	bb := new(bytes.Buffer)
-	zw, _ := gzip.NewWriterLevel(bb, gzip.NoCompression)
-	zw.Write(fileDescriptor_89be98e26346f54e)
-	zw.Close()
-	return bb.Bytes()
-}()
+var fileDescriptor_89be98e26346f54e_gzipped = protoapi.CompressGZIP(fileDescriptor_89be98e26346f54e)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/test_public.pb.go b/internal/testprotos/test/test_public.pb.go
index f4e78e0..c75905d 100644
--- a/internal/testprotos/test/test_public.pb.go
+++ b/internal/testprotos/test/test_public.pb.go
@@ -4,9 +4,8 @@
 package test
 
 import (
-	bytes "bytes"
-	gzip "compress/gzip"
 	proto "github.com/golang/protobuf/proto"
+	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
@@ -69,13 +68,7 @@
 	0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74,
 }
 
-var fileDescriptor_36dd44afd5b47374_gzipped = func() []byte {
-	bb := new(bytes.Buffer)
-	zw, _ := gzip.NewWriterLevel(bb, gzip.NoCompression)
-	zw.Write(fileDescriptor_36dd44afd5b47374)
-	zw.Close()
-	return bb.Bytes()
-}()
+var fileDescriptor_36dd44afd5b47374_gzipped = protoapi.CompressGZIP(fileDescriptor_36dd44afd5b47374)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
 
diff --git a/internal/testprotos/test/test_weak.pb.go b/internal/testprotos/test/test_weak.pb.go
index 18149d6..98632fc 100644
--- a/internal/testprotos/test/test_weak.pb.go
+++ b/internal/testprotos/test/test_weak.pb.go
@@ -4,9 +4,8 @@
 package test
 
 import (
-	bytes "bytes"
-	gzip "compress/gzip"
 	proto "github.com/golang/protobuf/proto"
+	protoapi "github.com/golang/protobuf/protoapi"
 	protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
 	protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
 	reflect "reflect"
@@ -69,13 +68,7 @@
 	0x74, 0x65, 0x73, 0x74,
 }
 
-var fileDescriptor_c2b8edfebc4f71b3_gzipped = func() []byte {
-	bb := new(bytes.Buffer)
-	zw, _ := gzip.NewWriterLevel(bb, gzip.NoCompression)
-	zw.Write(fileDescriptor_c2b8edfebc4f71b3)
-	zw.Close()
-	return bb.Bytes()
-}()
+var fileDescriptor_c2b8edfebc4f71b3_gzipped = protoapi.CompressGZIP(fileDescriptor_c2b8edfebc4f71b3)
 
 const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)