diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2020-07-24 01:14:32 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-24 01:19:34 -0700 |
commit | c59b792f53f3aa4c24d1ca9442ffc44f6d4932df (patch) | |
tree | c6f8a4f172472d22ad9af0bfea97aff1550e6c3b /tools/go_marshal/gomarshal/generator.go | |
parent | 65b5e648022cb33d4c5b650a008cb18e4aa6f600 (diff) |
[go-marshal] Update API
- All Marshal* and Unmarshal* methods now require buffers to be correctly sized
- Only the Copy{In/Out} variants can handle smaller buffers (or address spaces)
PiperOrigin-RevId: 322953881
Diffstat (limited to 'tools/go_marshal/gomarshal/generator.go')
-rw-r--r-- | tools/go_marshal/gomarshal/generator.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/go_marshal/gomarshal/generator.go b/tools/go_marshal/gomarshal/generator.go index 177013dbb..19bcd4e6a 100644 --- a/tools/go_marshal/gomarshal/generator.go +++ b/tools/go_marshal/gomarshal/generator.go @@ -413,13 +413,13 @@ func (g *Generator) Run() error { for _, t := range g.collectMarshallableTypes(a, fsets[i]) { impl := g.generateOne(t, fsets[i]) // Collect Marshallable types referenced by the generated code. - for ref, _ := range impl.ms { + for ref := range impl.ms { ms[ref] = struct{}{} } impls = append(impls, impl) // Collect imports referenced by the generated code and add them to // the list of imports we need to copy to the generated code. - for name, _ := range impl.is { + for name := range impl.is { if !g.imports.markUsed(name) { panic(fmt.Sprintf("Generated code for '%s' referenced a non-existent import with local name '%s'. Either go-marshal needs to add an import to the generated file, or a package in an input source file has a package name differ from the final component of its path, which go-marshal doesn't know how to detect; use an import alias to work around this limitation.", impl.typeName(), name)) } |