mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +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 {
|
||||
fmt.Fprintf(buf, "// +build %s\n\n", g.Conditional)
|
||||
}
|
||||
buf.Write(boilerplate)
|
||||
|
||||
for _, outputPackage := range outputPackages {
|
||||
p := outputPackage.(*protobufPackage)
|
||||
|
@ -19,6 +19,8 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gogo/protobuf/vanity/command"
|
||||
|
||||
// dependencies that are required for our packages
|
||||
@ -28,5 +30,18 @@ import (
|
||||
)
|
||||
|
||||
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