标签: go protocol-buffers
我想在 Go 中使用 *big.Int 创建一个协议缓冲区消息。最好的方法是什么?
*big.Int
答案 0 :(得分:1)
big.Int 实现 encoding.TextMarshaler:https://golang.org/pkg/math/big/#Int.MarshalText
big.Int
encoding.TextMarshaler
...,您可以轻松地将 []byte 序列化为 protobuf。
[]byte