Skip to content

Commit

Permalink
protoc-gen-go-drpc: include version info in generated code
Browse files Browse the repository at this point in the history
Change-Id: I08c361fb926b61dfed273ae86ee3acd175f3cbb0
  • Loading branch information
zeebo committed Mar 3, 2021
1 parent 874d821 commit 0a6577a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/protoc-gen-go-drpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package main
import (
"flag"
"fmt"
"runtime/debug"
"strconv"
"strings"

Expand Down Expand Up @@ -34,6 +35,10 @@ func generateFile(plugin *protogen.Plugin, file *protogen.File, protolib string)
d := &drpc{gf, file}

d.P("// Code generated by protoc-gen-go-drpc. DO NOT EDIT.")
if bi, ok := debug.ReadBuildInfo(); ok {
d.P("// protoc-gen-go-drpc version: ", bi.Main.Version)
}
d.P("// source: ", file.Desc.Path())
d.P()
d.P("package ", file.GoPackageName)
d.P()
Expand Down
2 changes: 2 additions & 0 deletions examples/drpc/pb/sesamestreet_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/drpc_and_http/pb/sesamestreet_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/grpc_and_drpc/pb/sesamestreet_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/backcompat/newservicedefs/servicedefs_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/grpccompat/service_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/integration/customservice/service_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/integration/gogoservice/service_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/integration/service/service_drpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0a6577a

Please sign in to comment.