Return nil error from final return in unpack*() (#881)

This is consistent with the pack*() functions and is idiomatic Go.
This commit is contained in:
Tom Thorogood 2019-01-03 21:14:50 +10:30 committed by Miek Gieben
parent bfd648e102
commit f9fcf1448b
2 changed files with 144 additions and 72 deletions

View File

@ -191,6 +191,7 @@ if rr.%s != "-" {
return rr, off, nil
}
var err error
_ = err
rdStart := off
_ = rdStart
@ -292,7 +293,7 @@ return rr, off, nil
`)
}
}
fmt.Fprintf(b, "return rr, off, err }\n\n")
fmt.Fprintf(b, "return rr, off, nil }\n\n")
}
// Generate typeToUnpack map
fmt.Fprintln(b, "var typeToUnpack = map[uint16]func(RR_Header, []byte, int) (RR, int, error){")

213
zmsg.go

File diff suppressed because it is too large Load Diff