فهرست منبع

internal/cmd/generate-alias: avoid generating version markers

We control both v1 and v2.
The generated version markers are just a nuisance.

Change-Id: I0d3248b20414f6279a83f7159bc3a4493619ce36
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/191677
Reviewed-by: Damien Neil <dneil@google.com>
Joe Tsai 6 سال پیش
والد
کامیت
fb8eeff771

+ 1 - 0
internal/cmd/generate-alias/main.go

@@ -86,6 +86,7 @@ func main() {
 	check(err)
 	for _, file := range gen.Files {
 		if file.Generate {
+			gengo.GenerateVersionMarkers = false
 			gengo.GenerateFile(gen, file)
 		}
 	}

+ 0 - 11
protoc-gen-go/descriptor/descriptor.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto
 
 package descriptor
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/descriptor.proto.
 
 type FieldDescriptorProto_Type = descriptorpb.FieldDescriptorProto_Type

+ 0 - 11
protoc-gen-go/plugin/plugin.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/protoc-gen-go/plugin/plugin.proto
 
 package plugin_go
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/compiler/plugin.proto.
 
 type Version = pluginpb.Version

+ 0 - 11
ptypes/any/any.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/ptypes/any/any.proto
 
 package any
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/any.proto.
 
 type Any = anypb.Any

+ 0 - 11
ptypes/duration/duration.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/ptypes/duration/duration.proto
 
 package duration
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/duration.proto.
 
 type Duration = durationpb.Duration

+ 0 - 11
ptypes/empty/empty.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/ptypes/empty/empty.proto
 
 package empty
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/empty.proto.
 
 type Empty = emptypb.Empty

+ 0 - 11
ptypes/struct/struct.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/ptypes/struct/struct.proto
 
 package structpb
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/struct.proto.
 
 type NullValue = structpb.NullValue

+ 0 - 11
ptypes/timestamp/timestamp.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
 
 package timestamp
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/timestamp.proto.
 
 type Timestamp = timestamppb.Timestamp

+ 0 - 11
ptypes/wrappers/wrappers.pb.go

@@ -1,8 +1,4 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// 	protoc-gen-go v1.19.0-devel
-// 	protoc        (unknown)
-// 	go            v1.12.5
 // source: github.com/golang/protobuf/ptypes/wrappers/wrappers.proto
 
 package wrappers
@@ -15,13 +11,6 @@ import (
 	sync "sync"
 )
 
-const (
-	// Verify that this generated code is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion)
-	// Verify that runtime/protoimpl is sufficiently up-to-date.
-	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19)
-)
-
 // Symbols defined in public import of google/protobuf/wrappers.proto.
 
 type DoubleValue = wrapperspb.DoubleValue