Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: mojo/public/go/bindings/message.go

Issue 948343008: go/bindings: update code to pass structs versions tests (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/go/bindings/decoder.go ('k') | mojo/public/tools/bindings/generators/go_templates/source.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/go/bindings/message.go
diff --git a/mojo/public/go/bindings/message.go b/mojo/public/go/bindings/message.go
index e5c832975a8f217ffa655cc0ba925f90596f2952..8455cd4b1e1323c4a11fc7a9120de09dfde2337d 100644
--- a/mojo/public/go/bindings/message.go
+++ b/mojo/public/go/bindings/message.go
@@ -68,10 +68,11 @@ func (h *MessageHeader) Encode(encoder *Encoder) error {
}
func (h *MessageHeader) Decode(decoder *Decoder) error {
- numFields, err := decoder.StartStruct()
+ header, err := decoder.StartStruct()
if err != nil {
return err
}
+ numFields := header.ElementsOrVersion
if numFields < 2 || numFields > 3 {
return fmt.Errorf("Invalid message header: it should have 2 or 3 fileds, but has %d", numFields)
}
« no previous file with comments | « mojo/public/go/bindings/decoder.go ('k') | mojo/public/tools/bindings/generators/go_templates/source.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698