go-marshal: Stop complaining about files with no +marshal types.

Since we tag entire packages as marshallable, due to conditional
compiling for different architectures we can end up with sets of
source files that don't contain any marshallable types. It's safe to
silently ignore this scenario.

PiperOrigin-RevId: 295831871
This commit is contained in:
gVisor bot
2020-02-18 15:09:17 -08:00
parent a3582de618
commit 737a3d072e
-11
View File
@@ -338,17 +338,6 @@ func (g *Generator) Run() error {
}
}
// Tool was invoked with input files with no data structures marked for code
// generation. This is probably not what the user intended.
if len(impls) == 0 {
var buf bytes.Buffer
fmt.Fprintf(&buf, "go_marshal invoked on these files, but they don't contain any types requiring code generation. Perhaps mark some with \"// +marshal\"?:\n")
for _, i := range g.inputs {
fmt.Fprintf(&buf, " %s\n", i)
}
abort(buf.String())
}
// Write output file header. These include things like package name and
// import statements.
if err := g.writeHeader(); err != nil {