func (mj *Event) MarshalJSONBuf(buf fflib.EncodingBuffer) error { var err error var obj []byte _ = obj _ = err buf.WriteString(`{"host":`) fflib.WriteJsonString(buf, string(mj.Host)) buf.WriteString(`,"service":`) fflib.WriteJsonString(buf, string(mj.Service)) buf.WriteString(`,"sub_service":`) fflib.WriteJsonString(buf, string(mj.SubService)) buf.WriteString(`,"metric":`) fflib.AppendFloat(buf, float64(mj.Metric), 'g', -1, 64) if mj.Tags == nil { buf.WriteString(`,"tags":null`) } else { buf.WriteString(`,"tags":{ `) for key, value := range mj.Tags { fflib.WriteJsonString(buf, key) buf.WriteString(`:`) fflib.WriteJsonString(buf, string(value)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') } buf.WriteByte('}') return nil }
func (mj *ResponseCountry) MarshalJSONBuf(buf fflib.EncodingBuffer) error { var err error var obj []byte _ = obj _ = err buf.WriteString(`{ `) if mj.Data != nil { if true { buf.WriteString(`"Data":`) { err = mj.Data.MarshalJSONBuf(buf) if err != nil { return err } } buf.WriteByte(',') } } if len(mj.Error) != 0 { buf.WriteString(`"Error":`) fflib.WriteJsonString(buf, string(mj.Error)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') return nil }
func (mj *Error) MarshalJSONBuf(buf fflib.EncodingBuffer) error { if mj == nil { buf.WriteString("null") return nil } var err error var obj []byte _ = obj _ = err buf.WriteString(`{ "error":`) fflib.WriteJsonString(buf, string(mj.Code)) buf.WriteByte(',') if len(mj.Description) != 0 { buf.WriteString(`"error_description":`) fflib.WriteJsonString(buf, string(mj.Description)) buf.WriteByte(',') } if len(mj.URI) != 0 { buf.WriteString(`"error_uri":`) fflib.WriteJsonString(buf, string(mj.URI)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') return nil }
func (mj *TheCountry) MarshalJSONBuf(buf fflib.EncodingBuffer) error { var err error var obj []byte var scratch fflib.FormatBitsScratch _ = scratch _ = obj _ = err buf.WriteString(`{"GeoNameID":`) fflib.FormatBits(&scratch, buf, uint64(mj.GeoNameID), 10, false) buf.WriteString(`,"IsoCode":`) fflib.WriteJsonString(buf, string(mj.IsoCode)) if mj.Names == nil { buf.WriteString(`,"Names":null`) } else { buf.WriteString(`,"Names":{ `) for key, value := range mj.Names { fflib.WriteJsonString(buf, key) buf.WriteString(`:`) fflib.WriteJsonString(buf, string(value)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') } buf.WriteByte('}') return nil }
func (mj *Incident) MarshalJSONBuf(buf fflib.EncodingBuffer) error { var err error var obj []byte _ = obj _ = err buf.WriteString(`{"event":`) if mj.EventName != nil { buf.WriteString(`"`) { enc := base64.NewEncoder(base64.StdEncoding, buf) enc.Write(reflect.Indirect(reflect.ValueOf(mj.EventName)).Bytes()) enc.Close() } buf.WriteString(`"`) } else { buf.WriteString(`null`) } buf.WriteString(`,"time":`) fflib.FormatBits2(buf, uint64(mj.Time), 10, mj.Time < 0) buf.WriteString(`,"id":`) fflib.FormatBits2(buf, uint64(mj.Id), 10, mj.Id < 0) if mj.Active { buf.WriteString(`,"active":true`) } else { buf.WriteString(`,"active":false`) } buf.WriteString(`,"escalation":`) fflib.WriteJsonString(buf, string(mj.Escalation)) buf.WriteString(`,"description":`) fflib.WriteJsonString(buf, string(mj.Description)) buf.WriteString(`,"policy":`) fflib.WriteJsonString(buf, string(mj.Policy)) buf.WriteString(`,"status":`) fflib.FormatBits2(buf, uint64(mj.Status), 10, mj.Status < 0) buf.WriteString(`,"host":`) fflib.WriteJsonString(buf, string(mj.Host)) buf.WriteString(`,"service":`) fflib.WriteJsonString(buf, string(mj.Service)) buf.WriteString(`,"sub_service":`) fflib.WriteJsonString(buf, string(mj.SubService)) buf.WriteString(`,"metric":`) fflib.AppendFloat(buf, float64(mj.Metric), 'g', -1, 64) if mj.Tags == nil { buf.WriteString(`,"tags":null`) } else { buf.WriteString(`,"tags":{ `) for key, value := range mj.Tags { fflib.WriteJsonString(buf, key) buf.WriteString(`:`) fflib.WriteJsonString(buf, string(value)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') } buf.WriteByte('}') return nil }
func (mj *Entry) MarshalJSONBuf(buf fflib.EncodingBuffer) error { var err error var obj []byte var scratch fflib.FormatBitsScratch _ = scratch _ = obj _ = err buf.WriteString(`{ "manufacturer":`) fflib.WriteJsonString(buf, string(mj.Manufacturer)) buf.WriteString(`,"address":`) if mj.Address != nil { buf.WriteString(`[`) for i, v := range mj.Address { if i != 0 { buf.WriteString(`,`) } fflib.WriteJsonString(buf, string(v)) } buf.WriteString(`]`) } else { buf.WriteString(`null`) } buf.WriteString(`,"prefix":`) { obj, err = mj.Prefix.MarshalJSON() if err != nil { return err } buf.Write(obj) } buf.WriteByte(',') if len(mj.Country) != 0 { buf.WriteString(`"country":`) fflib.WriteJsonString(buf, string(mj.Country)) buf.WriteByte(',') } if mj.Local != false { if mj.Local { buf.WriteString(`"local":true`) } else { buf.WriteString(`"local":false`) } buf.WriteByte(',') } if mj.Multicast != false { if mj.Multicast { buf.WriteString(`"multicast":true`) } else { buf.WriteString(`"multicast":false`) } buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') return nil }
func (mj *Event) MarshalJSONBuf(buf fflib.EncodingBuffer) error { if mj == nil { buf.WriteString("null") return nil } var err error var obj []byte _ = obj _ = err buf.WriteString(`{ "type":`) fflib.WriteJsonString(buf, string(mj.Type)) buf.WriteByte(',') if len(mj.Username) != 0 { buf.WriteString(`"username":`) fflib.WriteJsonString(buf, string(mj.Username)) buf.WriteByte(',') } if len(mj.Color) != 0 { buf.WriteString(`"color":`) fflib.WriteJsonString(buf, string(mj.Color)) buf.WriteByte(',') } if len(mj.Text) != 0 { buf.WriteString(`"text":`) fflib.WriteJsonString(buf, string(mj.Text)) buf.WriteByte(',') } if mj.TopicID != 0 { buf.WriteString(`"topic-id":`) fflib.FormatBits2(buf, uint64(mj.TopicID), 10, mj.TopicID < 0) buf.WriteByte(',') } buf.WriteString(`"option-a":`) fflib.WriteJsonString(buf, string(mj.OptionA)) buf.WriteString(`,"option-b":`) fflib.WriteJsonString(buf, string(mj.OptionB)) buf.WriteByte(',') if mj.VoteMask != 0 { buf.WriteString(`"vote-mask":`) fflib.FormatBits2(buf, uint64(mj.VoteMask), 10, false) buf.WriteByte(',') } if len(mj.Error) != 0 { buf.WriteString(`"error":`) fflib.WriteJsonString(buf, string(mj.Error)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') return nil }
func (mj *SubmitOutput) MarshalJSONBuf(buf fflib.EncodingBuffer) error { var err error var obj []byte _ = obj _ = err if mj.Success { buf.WriteString(`{ "success":true`) } else { buf.WriteString(`{ "success":false`) } buf.WriteByte(',') if len(mj.Error) != 0 { buf.WriteString(`"error":`) fflib.WriteJsonString(buf, string(mj.Error)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') return nil }
func (mj *JSONError) MarshalJSONBuf(buf fflib.EncodingBuffer) error { if mj == nil { buf.WriteString("null") return nil } var err error var obj []byte _ = obj _ = err buf.WriteString(`{ `) if mj.Status != 0 { buf.WriteString(`"status":`) fflib.FormatBits2(buf, uint64(mj.Status), 10, mj.Status < 0) buf.WriteByte(',') } if len(mj.Code) != 0 { buf.WriteString(`"code":`) fflib.WriteJsonString(buf, string(mj.Code)) buf.WriteByte(',') } if len(mj.Type) != 0 { buf.WriteString(`"type":`) fflib.WriteJsonString(buf, string(mj.Type)) buf.WriteByte(',') } if len(mj.Message) != 0 { buf.WriteString(`"message":`) fflib.WriteJsonString(buf, string(mj.Message)) buf.WriteByte(',') } if len(mj.MoreInfo) != 0 { buf.WriteString(`"moreInfo":`) fflib.WriteJsonString(buf, string(mj.MoreInfo)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') return nil }
func (mj *TokenResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error { if mj == nil { buf.WriteString("null") return nil } var err error var obj []byte _ = obj _ = err buf.WriteString(`{ "access_token":`) fflib.WriteJsonString(buf, string(mj.AccessToken)) buf.WriteString(`,"token_type":`) fflib.WriteJsonString(buf, string(mj.TokenType)) buf.WriteByte(',') if mj.ExpiresIn != 0 { buf.WriteString(`"expires_in":`) fflib.FormatBits2(buf, uint64(mj.ExpiresIn), 10, mj.ExpiresIn < 0) buf.WriteByte(',') } if len(mj.RefreshToken) != 0 { buf.WriteString(`"refresh_token":`) fflib.WriteJsonString(buf, string(mj.RefreshToken)) buf.WriteByte(',') } if len(mj.Scope) != 0 { buf.WriteString(`"scope":`) fflib.WriteJsonString(buf, string(mj.Scope)) buf.WriteByte(',') } if len(mj.State) != 0 { buf.WriteString(`"state":`) fflib.WriteJsonString(buf, string(mj.State)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') return nil }
func (mj *Character) MarshalJSONBuf(buf fflib.EncodingBuffer) error { if mj == nil { buf.WriteString("null") return nil } var err error var obj []byte _ = obj _ = err buf.WriteString(`{"character_id":`) fflib.WriteJsonString(buf, string(mj.ID)) /* Inline struct. type=struct { First string "json:\"first\""; Lower string "json:\"first_lower\"" } kind=struct */ buf.WriteString(`,"name":{ "first":`) fflib.WriteJsonString(buf, string(mj.Name.First)) buf.WriteString(`,"first_lower":`) fflib.WriteJsonString(buf, string(mj.Name.Lower)) buf.WriteByte('}') buf.WriteString(`,"faction_id":`) fflib.WriteJsonString(buf, string(mj.FactionID)) buf.WriteString(`,"title_id":`) fflib.WriteJsonString(buf, string(mj.TitleID)) /* Inline struct. type=struct { Creation string "json:\"creation\""; LastSave string "json:\"last_save\""; LastLogin string "json:\"last_login\""; LoginCount string "json:\"login_count\""; MinutesPlayed string "json:\"minutes_played\"" } kind=struct */ buf.WriteString(`,"times":{ "creation":`) fflib.WriteJsonString(buf, string(mj.Times.Creation)) buf.WriteString(`,"last_save":`) fflib.WriteJsonString(buf, string(mj.Times.LastSave)) buf.WriteString(`,"last_login":`) fflib.WriteJsonString(buf, string(mj.Times.LastLogin)) buf.WriteString(`,"login_count":`) fflib.WriteJsonString(buf, string(mj.Times.LoginCount)) buf.WriteString(`,"minutes_played":`) fflib.WriteJsonString(buf, string(mj.Times.MinutesPlayed)) buf.WriteByte('}') /* Inline struct. type=struct { Earned string "json:\"earned_points\""; Gifted string "json:\"gifted_points\""; Spent string "json:\"spent_points\""; Available string "json:\"available_points\""; PercentToNext string "json:\"percent_to_next\"" } kind=struct */ buf.WriteString(`,"certs":{ "earned_points":`) fflib.WriteJsonString(buf, string(mj.Certs.Earned)) buf.WriteString(`,"gifted_points":`) fflib.WriteJsonString(buf, string(mj.Certs.Gifted)) buf.WriteString(`,"spent_points":`) fflib.WriteJsonString(buf, string(mj.Certs.Spent)) buf.WriteString(`,"available_points":`) fflib.WriteJsonString(buf, string(mj.Certs.Available)) buf.WriteString(`,"percent_to_next":`) fflib.WriteJsonString(buf, string(mj.Certs.PercentToNext)) buf.WriteByte('}') /* Inline struct. type=struct { Rank string "json:\"value\""; PercentToNext string "json:\"percent_to_next\"" } kind=struct */ buf.WriteString(`,"battle_rank":{ "value":`) fflib.WriteJsonString(buf, string(mj.Battlerank.Rank)) buf.WriteString(`,"percent_to_next":`) fflib.WriteJsonString(buf, string(mj.Battlerank.PercentToNext)) buf.WriteByte('}') /* Inline struct. type=struct { Count string "json:\"count\""; Time string "json:\"time\"" } kind=struct */ buf.WriteString(`,"daily_ribbon":{ "count":`) fflib.WriteJsonString(buf, string(mj.DailyRibbon.Count)) buf.WriteString(`,"time":`) fflib.WriteJsonString(buf, string(mj.DailyRibbon.Time)) buf.WriteByte('}') buf.WriteString(`,"profile_id":`) fflib.WriteJsonString(buf, string(mj.ProfileID)) /* Inline struct. type=struct { ID string "json:\"outfit_id\""; Name string "json:\"name\""; Alias string "json:\"alias\""; LeaderID string "json:\"leader_character_id\""; MemberCount string "json:\"member_count\""; TimeCreated string "json:\"time_created\"" } kind=struct */ buf.WriteString(`,"outfit":{ "outfit_id":`) fflib.WriteJsonString(buf, string(mj.Outfit.ID)) buf.WriteString(`,"name":`) fflib.WriteJsonString(buf, string(mj.Outfit.Name)) buf.WriteString(`,"alias":`) fflib.WriteJsonString(buf, string(mj.Outfit.Alias)) buf.WriteString(`,"leader_character_id":`) fflib.WriteJsonString(buf, string(mj.Outfit.LeaderID)) buf.WriteString(`,"member_count":`) fflib.WriteJsonString(buf, string(mj.Outfit.MemberCount)) buf.WriteString(`,"time_created":`) fflib.WriteJsonString(buf, string(mj.Outfit.TimeCreated)) buf.WriteByte('}') buf.WriteString(`,"online_status":`) fflib.WriteJsonString(buf, string(mj.OnlineStatus)) /* Inline struct. type=struct { Stat []struct { Name string "json:\"stat_name\""; ProfileID string "json:\"profile_id\""; ValueForever string "json:\"value_forever\""; ValueMonthly string "json:\"value_monthly\""; ValueWeekly string "json:\"value_weekly\""; ValueDaily string "json:\"value_daily\""; ValueOneLifeMax string "json:\"value_one_life_max\""; LastSave string "json:\"last_save\"" } "json:\"stat\""; StatHistory []struct { Name string "json:\"stat_name\""; AllTime string "json:\"all_time\""; OneLifeMax string "json:\"one_life_max\""; Day map[string]string "json:\"day\""; Month map[string]string "json:\"Month\""; Week map[string]string "json:\"Week\"" } "json:\"stat_history\""; WeaponStat []struct { Name string "json:\"weapon_deaths\""; ItemID string "json:\"item_id\""; VehicleID string "json:\"vehicle_id\""; Value string "json:\"value\""; LastSave string "json:\"last_save\"" } "json:\"weapon_stat\"" } kind=struct */ buf.WriteString(`,"stats":{ "stat":`) if mj.Stats.Stat != nil { buf.WriteString(`[`) for i, v := range mj.Stats.Stat { if i != 0 { buf.WriteString(`,`) } /* Inline struct. type=struct { Name string "json:\"stat_name\""; ProfileID string "json:\"profile_id\""; ValueForever string "json:\"value_forever\""; ValueMonthly string "json:\"value_monthly\""; ValueWeekly string "json:\"value_weekly\""; ValueDaily string "json:\"value_daily\""; ValueOneLifeMax string "json:\"value_one_life_max\""; LastSave string "json:\"last_save\"" } kind=struct */ buf.WriteString(`{ "stat_name":`) fflib.WriteJsonString(buf, string(v.Name)) buf.WriteString(`,"profile_id":`) fflib.WriteJsonString(buf, string(v.ProfileID)) buf.WriteString(`,"value_forever":`) fflib.WriteJsonString(buf, string(v.ValueForever)) buf.WriteString(`,"value_monthly":`) fflib.WriteJsonString(buf, string(v.ValueMonthly)) buf.WriteString(`,"value_weekly":`) fflib.WriteJsonString(buf, string(v.ValueWeekly)) buf.WriteString(`,"value_daily":`) fflib.WriteJsonString(buf, string(v.ValueDaily)) buf.WriteString(`,"value_one_life_max":`) fflib.WriteJsonString(buf, string(v.ValueOneLifeMax)) buf.WriteString(`,"last_save":`) fflib.WriteJsonString(buf, string(v.LastSave)) buf.WriteByte('}') } buf.WriteString(`]`) } else { buf.WriteString(`null`) } buf.WriteString(`,"stat_history":`) if mj.Stats.StatHistory != nil { buf.WriteString(`[`) for i, v := range mj.Stats.StatHistory { if i != 0 { buf.WriteString(`,`) } /* Inline struct. type=struct { Name string "json:\"stat_name\""; AllTime string "json:\"all_time\""; OneLifeMax string "json:\"one_life_max\""; Day map[string]string "json:\"day\""; Month map[string]string "json:\"Month\""; Week map[string]string "json:\"Week\"" } kind=struct */ buf.WriteString(`{ "stat_name":`) fflib.WriteJsonString(buf, string(v.Name)) buf.WriteString(`,"all_time":`) fflib.WriteJsonString(buf, string(v.AllTime)) buf.WriteString(`,"one_life_max":`) fflib.WriteJsonString(buf, string(v.OneLifeMax)) if v.Day == nil { buf.WriteString(`,"day":null`) } else { buf.WriteString(`,"day":{ `) for key, value := range v.Day { fflib.WriteJsonString(buf, key) buf.WriteString(`:`) fflib.WriteJsonString(buf, string(value)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') } if v.Month == nil { buf.WriteString(`,"Month":null`) } else { buf.WriteString(`,"Month":{ `) for key, value := range v.Month { fflib.WriteJsonString(buf, key) buf.WriteString(`:`) fflib.WriteJsonString(buf, string(value)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') } if v.Week == nil { buf.WriteString(`,"Week":null`) } else { buf.WriteString(`,"Week":{ `) for key, value := range v.Week { fflib.WriteJsonString(buf, key) buf.WriteString(`:`) fflib.WriteJsonString(buf, string(value)) buf.WriteByte(',') } buf.Rewind(1) buf.WriteByte('}') } buf.WriteByte('}') } buf.WriteString(`]`) } else { buf.WriteString(`null`) } buf.WriteString(`,"weapon_stat":`) if mj.Stats.WeaponStat != nil { buf.WriteString(`[`) for i, v := range mj.Stats.WeaponStat { if i != 0 { buf.WriteString(`,`) } /* Inline struct. type=struct { Name string "json:\"weapon_deaths\""; ItemID string "json:\"item_id\""; VehicleID string "json:\"vehicle_id\""; Value string "json:\"value\""; LastSave string "json:\"last_save\"" } kind=struct */ buf.WriteString(`{ "weapon_deaths":`) fflib.WriteJsonString(buf, string(v.Name)) buf.WriteString(`,"item_id":`) fflib.WriteJsonString(buf, string(v.ItemID)) buf.WriteString(`,"vehicle_id":`) fflib.WriteJsonString(buf, string(v.VehicleID)) buf.WriteString(`,"value":`) fflib.WriteJsonString(buf, string(v.Value)) buf.WriteString(`,"last_save":`) fflib.WriteJsonString(buf, string(v.LastSave)) buf.WriteByte('}') } buf.WriteString(`]`) } else { buf.WriteString(`null`) } buf.WriteByte('}') /* Inline struct. type=struct { Name struct { En string "json:\"en\""; De string "json:\"de\""; Es string "json:\"es\""; Fr string "json:\"fr\""; It string "json:\"it\""; Tr string "json:\"tr\"" } "json:\"name\""; ImageSetID string "json:\"image_set_id\""; ImageID string "json:\"image_id\""; ImagePath string "json:\"image_path\""; CodeTag string "json:\"code_tag\""; UserSelectable string "json:\"user_selectable\"" } kind=struct */ /* Inline struct. type=struct { En string "json:\"en\""; De string "json:\"de\""; Es string "json:\"es\""; Fr string "json:\"fr\""; It string "json:\"it\""; Tr string "json:\"tr\"" } kind=struct */ buf.WriteString(`,"faction":{ "name":{ "en":`) fflib.WriteJsonString(buf, string(mj.Faction.Name.En)) buf.WriteString(`,"de":`) fflib.WriteJsonString(buf, string(mj.Faction.Name.De)) buf.WriteString(`,"es":`) fflib.WriteJsonString(buf, string(mj.Faction.Name.Es)) buf.WriteString(`,"fr":`) fflib.WriteJsonString(buf, string(mj.Faction.Name.Fr)) buf.WriteString(`,"it":`) fflib.WriteJsonString(buf, string(mj.Faction.Name.It)) buf.WriteString(`,"tr":`) fflib.WriteJsonString(buf, string(mj.Faction.Name.Tr)) buf.WriteByte('}') buf.WriteString(`,"image_set_id":`) fflib.WriteJsonString(buf, string(mj.Faction.ImageSetID)) buf.WriteString(`,"image_id":`) fflib.WriteJsonString(buf, string(mj.Faction.ImageID)) buf.WriteString(`,"image_path":`) fflib.WriteJsonString(buf, string(mj.Faction.ImagePath)) buf.WriteString(`,"code_tag":`) fflib.WriteJsonString(buf, string(mj.Faction.CodeTag)) buf.WriteString(`,"user_selectable":`) fflib.WriteJsonString(buf, string(mj.Faction.UserSelectable)) buf.WriteByte('}') buf.WriteString(`,"items":`) if mj.Items != nil { buf.WriteString(`[`) for i, v := range mj.Items { if i != 0 { buf.WriteString(`,`) } /* Inline struct. type=struct { ID string "json:\"item_id\""; StackCount string "json:\"stack_count\"" } kind=struct */ buf.WriteString(`{ "item_id":`) fflib.WriteJsonString(buf, string(v.ID)) buf.WriteString(`,"stack_count":`) fflib.WriteJsonString(buf, string(v.StackCount)) buf.WriteByte('}') } buf.WriteString(`]`) } else { buf.WriteString(`null`) } buf.WriteString(`,"friends_list":`) if mj.FriendsList != nil { buf.WriteString(`[`) for i, v := range mj.FriendsList { if i != 0 { buf.WriteString(`,`) } /* Inline struct. type=struct { ID string "json:\"character_id\""; LastLoginTime string "json:\"last_login_time\""; Onlint string "json:\"online\"" } kind=struct */ buf.WriteString(`{ "character_id":`) fflib.WriteJsonString(buf, string(v.ID)) buf.WriteString(`,"last_login_time":`) fflib.WriteJsonString(buf, string(v.LastLoginTime)) buf.WriteString(`,"online":`) fflib.WriteJsonString(buf, string(v.Onlint)) buf.WriteByte('}') } buf.WriteString(`]`) } else { buf.WriteString(`null`) } buf.WriteString(`,"world_id":`) fflib.WriteJsonString(buf, string(mj.World)) buf.WriteString(`,"error":`) fflib.WriteJsonString(buf, string(mj.Error)) buf.WriteString(`,"expires":`) { obj, err = mj.Expires.MarshalJSON() if err != nil { return err } buf.Write(obj) } buf.WriteString(`,"last-updated":`) { obj, err = mj.LastUpdated.MarshalJSON() if err != nil { return err } buf.Write(obj) } buf.WriteByte('}') return nil }