Skip to content

Commit bee6320

Browse files
committed
types: add compile time check pragma
1 parent cb22f23 commit bee6320

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

types_gojay.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ func (r *wireRequest) MarshalJSONObject(enc *gojay.Encoder) {
8989
// IsNil returns wether the structure is nil value or not
9090
func (r *wireRequest) IsNil() bool { return r == nil }
9191

92+
// compile time check whether the wireRequest implements a gojay.MarshalerJSONObject interface.
93+
var _ gojay.MarshalerJSONObject = (*wireRequest)(nil)
94+
95+
// compile time check whether the wireRequest implements a gojay.UnmarshalerJSONObject interface.
96+
var _ gojay.UnmarshalerJSONObject = (*wireRequest)(nil)
97+
9298
// UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
9399
func (r *wireResponse) UnmarshalJSONObject(dec *gojay.Decoder, k string) error {
94100
switch k {
@@ -125,6 +131,12 @@ func (r *wireResponse) MarshalJSONObject(enc *gojay.Encoder) {
125131
// IsNil returns wether the structure is nil value or not
126132
func (r *wireResponse) IsNil() bool { return r == nil }
127133

134+
// compile time check whether the wireResponse implements a gojay.MarshalerJSONObject interface.
135+
var _ gojay.MarshalerJSONObject = (*wireResponse)(nil)
136+
137+
// compile time check whether the wireResponse implements a gojay.UnmarshalerJSONObject interface.
138+
var _ gojay.UnmarshalerJSONObject = (*wireResponse)(nil)
139+
128140
// UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
129141
func (r *Combined) UnmarshalJSONObject(dec *gojay.Decoder, k string) error {
130142
switch k {
@@ -173,6 +185,12 @@ func (r *Combined) MarshalJSONObject(enc *gojay.Encoder) {
173185
// IsNil returns wether the structure is nil value or not
174186
func (r *Combined) IsNil() bool { return r == nil }
175187

188+
// compile time check whether the Combined implements a gojay.MarshalerJSONObject interface.
189+
var _ gojay.MarshalerJSONObject = (*Combined)(nil)
190+
191+
// compile time check whether the Combined implements a gojay.UnmarshalerJSONObject interface.
192+
var _ gojay.UnmarshalerJSONObject = (*Combined)(nil)
193+
176194
// UnmarshalJSONObject implements gojay's UnmarshalerJSONObject
177195
func (m *NotificationMessage) UnmarshalJSONObject(dec *gojay.Decoder, k string) error {
178196
switch k {
@@ -201,3 +219,9 @@ func (m *NotificationMessage) MarshalJSONObject(enc *gojay.Encoder) {
201219

202220
// IsNil returns wether the structure is nil value or not
203221
func (m *NotificationMessage) IsNil() bool { return m == nil }
222+
223+
// compile time check whether the NotificationMessage implements a gojay.MarshalerJSONObject interface.
224+
var _ gojay.MarshalerJSONObject = (*NotificationMessage)(nil)
225+
226+
// compile time check whether the NotificationMessage implements a gojay.UnmarshalerJSONObject interface.
227+
var _ gojay.UnmarshalerJSONObject = (*NotificationMessage)(nil)

0 commit comments

Comments
 (0)