pb_obj.Score
's type seems to be *uint64
(pointer to uint64
), not uint64
. You just need to access to the value the pointer is referencing:
score := int64(*pb_obj.Score)
(See the *
prefix as the difference)
I have a field that is of type fixed64
in a .proto file.
I want to read it as an int64 field:
score := int64(pb_obj.Score)
When I try to compile the line agove I get the error message cannot convert pb_obj.Score (type *uint64) to type int64
. I tried converting the a uint64 as well, and got an almost identical message.