I'm using "google/protobuf/timestamp.proto" to define timestamp type in golang struct:
import "google/protobuf/timestamp.proto";
message User {
string id = 1;
...
google.protobuf.Timestamp created_at = 12;
google.protobuf.Timestamp updated_at = 13;
google.protobuf.Timestamp last_login = 14;
}
and when insert to cassandra using cqlx:
req.CreatedAt = ptypes.TimestampNow()
// I also try with:
// req.CreatedAt = ×tamp.Timestamp{Seconds: time.Now().Unix(), Nanos: int32(time.Now().Nanosecond())}
I always get this error message: can not marshal timestamp.Timestamp into timestamp. Anyone have work with this please help