1package issue260
2
3import (
4	"encoding/json"
5	"time"
6
7	"github.com/gogo/protobuf/jsonpb"
8)
9
10type Dropped struct {
11	Name string
12	Age  int32
13}
14
15func (d *Dropped) UnmarshalJSONPB(u *jsonpb.Unmarshaler, b []byte) error {
16	return json.Unmarshal(b, d)
17}
18
19func (d *Dropped) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error) {
20	return json.Marshal(d)
21}
22
23func (d *Dropped) Drop() bool {
24	return true
25}
26
27type DroppedWithoutGetters struct {
28	Width             int64
29	Height            int64
30	Timestamp         time.Time  `protobuf:"bytes,3,opt,name=timestamp,stdtime" json:"timestamp"`
31	NullableTimestamp *time.Time `protobuf:"bytes,4,opt,name=nullable_timestamp,json=nullableTimestamp,stdtime" json:"nullable_timestamp,omitempty"`
32}
33
34func (d *DroppedWithoutGetters) UnmarshalJSONPB(u *jsonpb.Unmarshaler, b []byte) error {
35	return json.Unmarshal(b, d)
36}
37
38func (d *DroppedWithoutGetters) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error) {
39	return json.Marshal(d)
40}
41