本文整理汇总了Golang中git/apache/org/thrift/git/lib/go/thrift.TProtocol.WriteDouble方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteDouble方法的具体用法?Golang TProtocol.WriteDouble怎么用?Golang TProtocol.WriteDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git/apache/org/thrift/git/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteDouble方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeField4
func (p *ColorMeta) writeField4(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("distance", thrift.DOUBLE, 4); err != nil {
return fmt.Errorf("%T write field begin error 4:distance: %s", p, err)
}
if err := oprot.WriteDouble(float64(p.Distance)); err != nil {
return fmt.Errorf("%T.distance (4) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 4:distance: %s", p, err)
}
return err
}
示例2: writeField2
func (p *ColorCount) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("percentage", thrift.DOUBLE, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:percentage: %s", p, err)
}
if err := oprot.WriteDouble(float64(p.Percentage)); err != nil {
return fmt.Errorf("%T.percentage (2) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:percentage: %s", p, err)
}
return err
}
示例3: writeField3
func (p *ColorMeta) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("search_factor", thrift.DOUBLE, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:search_factor: %s", p, err)
}
if err := oprot.WriteDouble(float64(p.SearchFactor)); err != nil {
return fmt.Errorf("%T.search_factor (3) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 3:search_factor: %s", p, err)
}
return err
}
示例4: writeField4
func (p *Item) writeField4(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("predictedPreferences", thrift.DOUBLE, 4); err != nil {
return fmt.Errorf("%T write field begin error 4:predictedPreferences: %s", p, err)
}
if err := oprot.WriteDouble(float64(p.PredictedPreferences)); err != nil {
return fmt.Errorf("%T.predictedPreferences (4) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 4:predictedPreferences: %s", p, err)
}
return err
}
示例5: writeField13
func (p *FichaVisitaDomiciliarChildThrift) writeField13(oprot thrift.TProtocol) (err error) {
if p.IsSetAlturaAcompanhamentoNutricional() {
if err := oprot.WriteFieldBegin("alturaAcompanhamentoNutricional", thrift.DOUBLE, 13); err != nil {
return fmt.Errorf("%T write field begin error 13:alturaAcompanhamentoNutricional: %s", p, err)
}
if err := oprot.WriteDouble(float64(*p.AlturaAcompanhamentoNutricional)); err != nil {
return fmt.Errorf("%T.alturaAcompanhamentoNutricional (13) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 13:alturaAcompanhamentoNutricional: %s", p, err)
}
}
return err
}
示例6: writeField5
func (p *ParticipanteRowItemThrift) writeField5(oprot thrift.TProtocol) (err error) {
if p.IsSetAltura() {
if err := oprot.WriteFieldBegin("altura", thrift.DOUBLE, 5); err != nil {
return fmt.Errorf("%T write field begin error 5:altura: %s", p, err)
}
if err := oprot.WriteDouble(float64(*p.Altura)); err != nil {
return fmt.Errorf("%T.altura (5) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 5:altura: %s", p, err)
}
}
return err
}
示例7: writeField4
func (p *ParticipanteRowItemThrift) writeField4(oprot thrift.TProtocol) (err error) {
if p.IsSetPeso() {
if err := oprot.WriteFieldBegin("peso", thrift.DOUBLE, 4); err != nil {
return fmt.Errorf("%T write field begin error 4:peso: %s", p, err)
}
if err := oprot.WriteDouble(float64(*p.Peso)); err != nil {
return fmt.Errorf("%T.peso (4) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 4:peso: %s", p, err)
}
}
return err
}
示例8: writeField4
func (p *Types) writeField4(oprot thrift.TProtocol) (err error) {
if p.IsSetDoubleValue() {
if err := oprot.WriteFieldBegin("double_value", thrift.DOUBLE, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:double_value: ", p), err)
}
if err := oprot.WriteDouble(float64(*p.DoubleValue)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.double_value (4) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:double_value: ", p), err)
}
}
return err
}