Skip to content

Commit 3095c08

Browse files
author
Aleksander Korelskiy
committed
wrapper boolValue conversion added
1 parent 9570035 commit 3095c08

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/main/go/wrappers.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,22 @@ func ProtoToNilInt32(d *wrappers.Int32Value) *int32 {
9898
}
9999
t := d.Value
100100
return &t
101-
}
101+
}
102+
103+
func NilBoolToProto(d *bool) *wrappers.BoolValue {
104+
if d == nil {
105+
return nil
106+
}
107+
return &wrappers.BoolValue{
108+
Value: *d,
109+
}
110+
}
111+
112+
func ProtoToNilBool(d *wrappers.BoolValue) *bool {
113+
if d == nil {
114+
return nil
115+
}
116+
t := d.Value
117+
return &t
118+
}
119+

0 commit comments

Comments
 (0)