Procházet zdrojové kódy

cmd/protoc-gen-go: remove go version from header

The Go toolchain version isn't particularly interesting; short of bugs
in the toolchain, the protoc-gen-go output should be identical for any
version of the compiler and stdlib. Including it introduces pointless
variance in generated output when switching between compiler versions.

Change-Id: I74a709cf227ecf68dd62579947e03c07349f04de
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/193122
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Damien Neil před 6 roky
rodič
revize
0e00e666b1
1 změnil soubory, kde provedl 0 přidání a 6 odebrání
  1. 0 6
      cmd/protoc-gen-go/internal_gengo/main.go

+ 0 - 6
cmd/protoc-gen-go/internal_gengo/main.go

@@ -11,7 +11,6 @@ import (
 	"go/parser"
 	"go/token"
 	"math"
-	"runtime"
 	"strconv"
 	"strings"
 	"unicode"
@@ -216,13 +215,8 @@ func genGeneratedHeader(gen *protogen.Plugin, g *protogen.GeneratedFile, f *file
 		if v := gen.Request.GetCompilerVersion(); v != nil {
 			protocVersion = fmt.Sprintf("v%v.%v.%v", v.GetMajor(), v.GetMinor(), v.GetPatch())
 		}
-		goVersion := runtime.Version()
-		if strings.HasPrefix(goVersion, "go") {
-			goVersion = "v" + goVersion[len("go"):]
-		}
 		g.P("// \tprotoc-gen-go ", protocGenGoVersion)
 		g.P("// \tprotoc        ", protocVersion)
-		g.P("// \tgo            ", goVersion)
 	}
 
 	if f.Proto.GetOptions().GetDeprecated() {