mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Fix protobuf generation
This commit is contained in:
parent
343125cc6c
commit
f68adbcd59
@ -260,6 +260,7 @@ func Run(g *Generator) {
|
|||||||
if len(g.Conditional) > 0 {
|
if len(g.Conditional) > 0 {
|
||||||
fmt.Fprintf(buf, "// +build %s\n\n", g.Conditional)
|
fmt.Fprintf(buf, "// +build %s\n\n", g.Conditional)
|
||||||
}
|
}
|
||||||
|
buf.Write(boilerplate)
|
||||||
|
|
||||||
for _, outputPackage := range outputPackages {
|
for _, outputPackage := range outputPackages {
|
||||||
p := outputPackage.(*protobufPackage)
|
p := outputPackage.(*protobufPackage)
|
||||||
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/vanity/command"
|
"github.com/gogo/protobuf/vanity/command"
|
||||||
|
|
||||||
// dependencies that are required for our packages
|
// dependencies that are required for our packages
|
||||||
@ -28,5 +30,18 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
command.Write(command.Generate(command.Read()))
|
// read input
|
||||||
|
request := command.Read()
|
||||||
|
|
||||||
|
// if we're given paths as inputs, generate .pb.go files based on those paths
|
||||||
|
for _, file := range request.FileToGenerate {
|
||||||
|
if strings.Contains(file, "/") {
|
||||||
|
param := "paths=source_relative"
|
||||||
|
request.Parameter = ¶m
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// generate
|
||||||
|
command.Write(command.Generate(request))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user