From 4394568c4bed76e9170dd11c611eb0a4c9c7a10c Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Tue, 6 Oct 2020 12:23:51 -0700 Subject: [PATCH] cmd/protoc-gen-go: remove reference to legacy ProtoPackageIsVersion4 A reference to this constant was originally generated to ensure that users were using a sufficiently new version of the github.com/golnag/protobuf module to avoid subtle runtime incompatibility issues. Such a technique is not needed if users were using modules, which would enforce this constraint based on our go.mod requirements. When we first released the google.golang.org/protobuf module, we suggested that we would consider removing it after 6 months. It has now been 7 months since the release. Fixes golang/protobuf#1077 Change-Id: I9f2010da27b27fe6b12541a15833721441df8409 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/259901 Reviewed-by: Damien Neil Trust: Joe Tsai --- cmd/protoc-gen-go/internal_gengo/main.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go index 5f559766..70819339 100644 --- a/cmd/protoc-gen-go/internal_gengo/main.go +++ b/cmd/protoc-gen-go/internal_gengo/main.go @@ -88,12 +88,6 @@ func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.Generated g.P("_ = ", protoimplPackage.Ident("EnforceVersion"), "(", protoimplPackage.Ident("MaxVersion"), " - ", protoimpl.GenVersion, ")") g.P(")") g.P() - - // TODO: Remove this after some soak-in period after the v2 release. - g.P("// This is a compile-time assertion that a sufficiently up-to-date version") - g.P("// of the legacy proto package is being used.") - g.P("const _ = ", protoV1Package.Ident("ProtoPackageIsVersion4")) - g.P() } for i, imps := 0, f.Desc.Imports(); i < imps.Len(); i++ {