mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #101624 from tilt-dev/nicks/go-to-protobuf
go-to-protobuf: small fixes to improve debuggability
This commit is contained in:
commit
39e951a08d
@ -23,11 +23,13 @@ import (
|
|||||||
|
|
||||||
flag "github.com/spf13/pflag"
|
flag "github.com/spf13/pflag"
|
||||||
"k8s.io/code-generator/cmd/go-to-protobuf/protobuf"
|
"k8s.io/code-generator/cmd/go-to-protobuf/protobuf"
|
||||||
|
"k8s.io/klog/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var g = protobuf.New()
|
var g = protobuf.New()
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
klog.InitFlags(nil)
|
||||||
g.BindFlags(flag.CommandLine)
|
g.BindFlags(flag.CommandLine)
|
||||||
goflag.Set("logtostderr", "true")
|
goflag.Set("logtostderr", "true")
|
||||||
flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
|
flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
|
||||||
|
@ -364,7 +364,12 @@ func Run(g *Generator) {
|
|||||||
func deps(c *generator.Context, pkgs []*protobufPackage) map[string][]string {
|
func deps(c *generator.Context, pkgs []*protobufPackage) map[string][]string {
|
||||||
ret := map[string][]string{}
|
ret := map[string][]string{}
|
||||||
for _, p := range pkgs {
|
for _, p := range pkgs {
|
||||||
for _, d := range c.Universe[p.PackagePath].Imports {
|
pkg, ok := c.Universe[p.PackagePath]
|
||||||
|
if !ok {
|
||||||
|
log.Fatalf("Unrecognized package: %s", p.PackagePath)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, d := range pkg.Imports {
|
||||||
ret[p.PackagePath] = append(ret[p.PackagePath], d.Path)
|
ret[p.PackagePath] = append(ret[p.PackagePath], d.Path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user