diff --git a/cmd/protoc-gen-go-lite/internal_gengo/main.go b/cmd/protoc-gen-go-lite/internal_gengo/main.go index 6e47846a..020a0e4e 100644 --- a/cmd/protoc-gen-go-lite/internal_gengo/main.go +++ b/cmd/protoc-gen-go-lite/internal_gengo/main.go @@ -20,7 +20,6 @@ import ( "github.com/aperturerobotics/protobuf-go-lite/internal/editionssupport" "github.com/aperturerobotics/protobuf-go-lite/internal/encoding/tag" "github.com/aperturerobotics/protobuf-go-lite/internal/genid" - "github.com/aperturerobotics/protobuf-go-lite/internal/version" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/runtime/protoimpl" @@ -36,9 +35,6 @@ var ( SupportedEditionsMaximum = editionssupport.Maximum ) -// GenerateVersionMarkers specifies whether to generate version markers. -var GenerateVersionMarkers = true - // Standard library dependencies. const ( base64Package = protogen.GoImportPath("encoding/base64") @@ -83,17 +79,6 @@ func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.Generated g.P(packageDoc, "package ", f.GoPackageName) g.P() - // Emit a static check that enforces a minimum version of the proto package. - if GenerateVersionMarkers { - g.P("const (") - g.P("// Verify that this generated code is sufficiently up-to-date.") - g.P("_ = ", protoimplPackage.Ident("EnforceVersion"), "(", protoimpl.GenVersion, " - ", protoimplPackage.Ident("MinVersion"), ")") - g.P("// Verify that runtime/protoimpl is sufficiently up-to-date.") - g.P("_ = ", protoimplPackage.Ident("EnforceVersion"), "(", protoimplPackage.Ident("MaxVersion"), " - ", protoimpl.GenVersion, ")") - g.P(")") - g.P() - } - for i, imps := 0, f.Desc.Imports(); i < imps.Len(); i++ { genImport(gen, g, f, imps.Get(i)) } @@ -127,20 +112,6 @@ func genStandaloneComments(g *protogen.GeneratedFile, f *fileInfo, n int32) { func genGeneratedHeader(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) { g.P("// Code generated by protoc-gen-go-lite. DO NOT EDIT.") - if GenerateVersionMarkers { - g.P("// versions:") - protocGenGoVersion := version.String() - protocVersion := "(unknown)" - if v := gen.Request.GetCompilerVersion(); v != nil { - protocVersion = fmt.Sprintf("v%v.%v.%v", v.GetMajor(), v.GetMinor(), v.GetPatch()) - if s := v.GetSuffix(); s != "" { - protocVersion += "-" + s - } - } - g.P("// \tprotoc-gen-go-lite ", protocGenGoVersion) - g.P("// \tprotoc ", protocVersion) - } - if f.Proto.GetOptions().GetDeprecated() { g.P("// ", f.Desc.Path(), " is a deprecated file.") } else { diff --git a/internal/cmd/generate-protos/main.go b/internal/cmd/generate-protos/main.go index 18e15cb7..eb46455d 100644 --- a/internal/cmd/generate-protos/main.go +++ b/internal/cmd/generate-protos/main.go @@ -50,7 +50,6 @@ func init() { protogen.Options{}.Run(func(gen *protogen.Plugin) error { for _, file := range gen.Files { if file.Generate { - gengo.GenerateVersionMarkers = false gengo.GenerateFile(gen, file) generateIdentifiers(gen, file) generateSourceContextStringer(gen, file)