Use int64

This commit is contained in:
Yoshiyuki Mineo committed 2025-05-02 02:33:06 +09:00
1 parent eccf7b77c8
commit c847588763
4 files changed
+41 -43

No files matched your search

+2 -2
View File
@@ -34,13 +34,13 @@ func amazonEC2PrivateIPv4() (net.IP, error) {
// AmazonEC2MachineID retrieves the private IP address of the Amazon EC2 instance
// and returns its lower 16 bits.
// It works correctly on Docker as well.
func AmazonEC2MachineID() (uint16, error) {
func AmazonEC2MachineID() (int64, error) {
ip, err := amazonEC2PrivateIPv4()
if err != nil {
return 0, err
}
return uint16(ip[2])<<8 + uint16(ip[3]), nil
return int64(uint16(ip[2])<<8 + uint16(ip[3])), nil
}
// TimeDifference returns the time difference between the localhost and the given NTP server.