本文整理汇总了Golang中github.com/mailru/easyjson/jlexer.Lexer.Raw方法的典型用法代码示例。如果您正苦于以下问题:Golang Lexer.Raw方法的具体用法?Golang Lexer.Raw怎么用?Golang Lexer.Raw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/mailru/easyjson/jlexer.Lexer
的用法示例。
在下文中一共展示了Lexer.Raw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: easyjson_decode_go_serialization_benchmarks_A
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('}')
}
示例2: UnmarshalEasyJSON
// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface.
func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) {
*v = RawMessage(l.Raw())
}