From fc9592f7ac4bade8f83e636263f8f07715c698d1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Mianzhynski Date: Tue, 30 Mar 2021 20:16:43 +0300 Subject: [PATCH] cmd/protoc-gen-go: add protoc suffix Change-Id: Ib09bd3cbd15088d534de34b08d01a4d7a4880c0a Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/306209 Reviewed-by: Joe Tsai Reviewed-by: Damien Neil Trust: Joe Tsai Trust: Damien Neil --- cmd/protoc-gen-go/internal_gengo/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go index 2c740411..675488ad 100644 --- a/cmd/protoc-gen-go/internal_gengo/main.go +++ b/cmd/protoc-gen-go/internal_gengo/main.go @@ -128,6 +128,9 @@ func genGeneratedHeader(gen *protogen.Plugin, g *protogen.GeneratedFile, f *file 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 ", protocGenGoVersion) g.P("// \tprotoc ", protocVersion)