[#108] protogen: Distinguish between empty and nil messages
All checks were successful
DCO action / DCO (pull_request) Successful in 39s
Tests and linters / Tests (1.22) (pull_request) Successful in 59s
Tests and linters / Tests (1.23) (pull_request) Successful in 57s
Tests and linters / Tests with -race (pull_request) Successful in 1m9s
Tests and linters / Lint (pull_request) Successful in 2m12s
All checks were successful
DCO action / DCO (pull_request) Successful in 39s
Tests and linters / Tests (1.22) (pull_request) Successful in 59s
Tests and linters / Tests (1.23) (pull_request) Successful in 57s
Tests and linters / Tests with -race (pull_request) Successful in 1m9s
Tests and linters / Lint (pull_request) Successful in 2m12s
Refs #59 Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
11e194d274
commit
5fece80b42
18 changed files with 282 additions and 283 deletions
|
@ -174,7 +174,7 @@ func emitMarshalRaw(g *protogen.GeneratedFile, f *protogen.Field, name string) {
|
|||
name += "[i]"
|
||||
}
|
||||
|
||||
g.P("if ", notNil(name), " && ", name, ".StableSize() != 0 {")
|
||||
g.P("if ", notNil(name), " {")
|
||||
g.P(name, ".EmitProtobuf(mm.AppendMessage(", f.Desc.Number(), "))")
|
||||
g.P("}")
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue