本文整理匯總了Golang中github.com/mailru/easyjson/jwriter.Writer.Float64方法的典型用法代碼示例。如果您正苦於以下問題:Golang Writer.Float64方法的具體用法?Golang Writer.Float64怎麽用?Golang Writer.Float64使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/mailru/easyjson/jwriter.Writer
的用法示例。
在下文中一共展示了Writer.Float64方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MarshalEasyJSON
// MarshalEasyJSON does JSON marshaling using easyjson interface.
func (v Float64) MarshalEasyJSON(w *jwriter.Writer) {
if v.Defined {
w.Float64(v.V)
} else {
w.RawString("null")
}
}
示例2: easyjson_encode_go_serialization_benchmarks_A
func easyjson_encode_go_serialization_benchmarks_A(out *jwriter.Writer, in *A) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"Name\":")
out.String(in.Name)
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"BirthDay\":")
out.Raw((in.BirthDay).MarshalJSON())
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"Phone\":")
out.String(in.Phone)
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"Siblings\":")
out.Int(in.Siblings)
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"Spouse\":")
out.Bool(in.Spouse)
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"Money\":")
out.Float64(in.Money)
out.RawByte('}')
}