forked from TrueCloudLab/frostfs-api-go
[#108] protogen: Distinguish between empty and nil messages
Refs #59 Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
11e194d274
commit
5fece80b42
18 changed files with 1 additions and 2 deletions
BIN
accounting/grpc/service_frostfs.pb.go
generated
BIN
accounting/grpc/service_frostfs.pb.go
generated
Binary file not shown.
BIN
acl/grpc/types_frostfs.pb.go
generated
BIN
acl/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
apemanager/grpc/service_frostfs.pb.go
generated
BIN
apemanager/grpc/service_frostfs.pb.go
generated
Binary file not shown.
BIN
container/grpc/service_frostfs.pb.go
generated
BIN
container/grpc/service_frostfs.pb.go
generated
Binary file not shown.
BIN
container/grpc/types_frostfs.pb.go
generated
BIN
container/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
lock/grpc/types_frostfs.pb.go
generated
BIN
lock/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
netmap/grpc/service_frostfs.pb.go
generated
BIN
netmap/grpc/service_frostfs.pb.go
generated
Binary file not shown.
BIN
netmap/grpc/types_frostfs.pb.go
generated
BIN
netmap/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
object/grpc/service_frostfs.pb.go
generated
BIN
object/grpc/service_frostfs.pb.go
generated
Binary file not shown.
BIN
object/grpc/types_frostfs.pb.go
generated
BIN
object/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
refs/grpc/types_frostfs.pb.go
generated
BIN
refs/grpc/types_frostfs.pb.go
generated
Binary file not shown.
|
@ -111,7 +111,6 @@ func testCompatibility(t *testing.T, msgGen func(empty bool) message.Message) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t.Run("empty", func(t *testing.T) {
|
t.Run("empty", func(t *testing.T) {
|
||||||
t.Skip()
|
|
||||||
msg := msgGen(true)
|
msg := msgGen(true)
|
||||||
t.Run(fmt.Sprintf("Binary_%T", msg), func(t *testing.T) {
|
t.Run(fmt.Sprintf("Binary_%T", msg), func(t *testing.T) {
|
||||||
compareBinary(t, msg)
|
compareBinary(t, msg)
|
||||||
|
|
BIN
session/grpc/service_frostfs.pb.go
generated
BIN
session/grpc/service_frostfs.pb.go
generated
Binary file not shown.
BIN
session/grpc/types_frostfs.pb.go
generated
BIN
session/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
status/grpc/types_frostfs.pb.go
generated
BIN
status/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
tombstone/grpc/types_frostfs.pb.go
generated
BIN
tombstone/grpc/types_frostfs.pb.go
generated
Binary file not shown.
BIN
util/proto/test/custom/test_frostfs.pb.go
generated
BIN
util/proto/test/custom/test_frostfs.pb.go
generated
Binary file not shown.
|
@ -174,7 +174,7 @@ func emitMarshalRaw(g *protogen.GeneratedFile, f *protogen.Field, name string) {
|
||||||
name += "[i]"
|
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(name, ".EmitProtobuf(mm.AppendMessage(", f.Desc.Number(), "))")
|
||||||
g.P("}")
|
g.P("}")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue