andreachild commented on code in PR #3090:
URL: https://github.com/apache/tinkerpop/pull/3090#discussion_r2038209536


##########
gremlin-go/driver/graphBinary.go:
##########
@@ -509,6 +510,39 @@ func timeWriter(value interface{}, buffer *bytes.Buffer, _ 
*graphBinaryTypeSeria
        return buffer.Bytes(), nil
 }
 
+func offsetDateTimeWriter(value interface{}, buffer *bytes.Buffer, _ 
*graphBinaryTypeSerializer) ([]byte, error) {
+       t := value.(time.Time)
+       err := binary.Write(buffer, binary.BigEndian, int32(t.Year()))
+       if err != nil {
+               return nil, err
+       }
+
+       err = binary.Write(buffer, binary.BigEndian, byte(t.Month()))
+       if err != nil {
+               return nil, err
+       }
+       err = binary.Write(buffer, binary.BigEndian, byte(t.Day()))
+       if err != nil {
+               return nil, err
+       }
+       // construct time of day in nanoseconds
+       h := t.Hour()

Review Comment:
   Q recommends type conversion to `int64` for these values to prevent issues 
with overflow on 32 bit systems.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to