func easyjson_decode_go_serialization_benchmarks_A(in *jlexer.Lexer, out *A) { in.Delim('{') for !in.IsDelim('}') { key := in.UnsafeString() in.WantColon() if in.IsNull() { in.Skip() in.WantComma() continue } switch key { case "Name": out.Name = in.String() case "BirthDay": if data := in.Raw(); in.Ok() { in.AddError((out.BirthDay).UnmarshalJSON(data)) } case "Phone": out.Phone = in.String() case "Siblings": out.Siblings = in.Int() case "Spouse": out.Spouse = in.Bool() case "Money": out.Money = in.Float64() default: in.SkipRecursive() } in.WantComma() } in.Delim('}') }
func (t *DateTime) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { tt, err := ParseDateTime(data) if err != nil { in.AddError(err) return } *t = tt } }
func (d *Duration) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { tt, err := ParseDuration(data) if err != nil { in.AddError(err) return } *d = Duration(tt) } }
func (t *Date) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { tt, err := time.Parse(RFC3339FullDate, data) if err != nil { in.AddError(err) return } *t = Date(tt) } }
func (b *Base64) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { enc := base64.StdEncoding dbuf := make([]byte, enc.DecodedLen(len(data))) n, err := enc.Decode(dbuf, []byte(data)) if err != nil { in.AddError(err) return } *b = dbuf[:n] } }
func (u *ISBN10) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *u = ISBN10(data) } }
func (u *UUID5) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *u = UUID5(data) } }
func (u *MAC) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *u = MAC(data) } }
func (h *Hostname) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *h = Hostname(data) } }
func (e *Email) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *e = Email(data) } }
func (r *Password) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *r = Password(data) } }
func (r *RGBColor) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *r = RGBColor(data) } }
func (h *HexColor) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *h = HexColor(data) } }
func (u *SSN) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *u = SSN(data) } }
func (u *CreditCard) UnmarshalEasyJSON(in *jlexer.Lexer) { if data := in.String(); in.Ok() { *u = CreditCard(data) } }