mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user