From 8948e68c22e8554861af7b68d39bb23083a443f0 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Mon, 30 Nov 2020 18:56:49 +0500 Subject: [PATCH] :boom: Changed coordinates type from float32 to float64 --- inline.go | 24 ++++++++++++------------ methods.go | 26 +++++++++++++------------- stickers.go | 6 +++--- types.go | 6 +++--- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/inline.go b/inline.go index 141ca76..56ab45f 100644 --- a/inline.go +++ b/inline.go @@ -392,16 +392,16 @@ type ( ID string `json:"id"` // Location latitude in degrees - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // Location longitude in degrees - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // Location title Title string `json:"title"` // The radius of uncertainty for the location, measured in meters; 0-1500 - HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"` + HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Period in seconds for which the location can be updated, should be between 60 and 86400. LivePeriod int `json:"live_period,omitempty"` @@ -440,10 +440,10 @@ type ( ID string `json:"id"` // Latitude of the venue location in degrees - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // Longitude of the venue location in degrees - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // Title of the venue Title string `json:"title"` @@ -817,13 +817,13 @@ type ( // inline query. InputLocationMessageContent struct { // Latitude of the location in degrees - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // Longitude of the location in degrees - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // The radius of uncertainty for the location, measured in meters; 0-1500 - HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"` + HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Period in seconds for which the location can be updated, should be between 60 and 86400. LivePeriod int `json:"live_period,omitempty"` @@ -841,10 +841,10 @@ type ( // query. InputVenueMessageContent struct { // Latitude of the location in degrees - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // Longitude of the location in degrees - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // Name of the venue Title string `json:"title"` @@ -1168,7 +1168,7 @@ func NewInlineQueryResultGif(id, gif, thumb string) InlineQueryResultGif { func (InlineQueryResultGif) IsCached() bool { return false } -func NewInlineQueryResultLocation(id, title string, lat, long float32) InlineQueryResultLocation { +func NewInlineQueryResultLocation(id, title string, lat, long float64) InlineQueryResultLocation { return InlineQueryResultLocation{ Type: TypeLocation, ID: id, @@ -1202,7 +1202,7 @@ func NewInlineQueryResultPhoto(id, photo, thumb string) InlineQueryResultPhoto { func (InlineQueryResultPhoto) IsCached() bool { return false } -func NewInlineQueryResultVenue(id, title, addr string, lat, long float32) InlineQueryResultVenue { +func NewInlineQueryResultVenue(id, title, addr string, lat, long float64) InlineQueryResultVenue { return InlineQueryResultVenue{ Type: TypeVenue, ID: id, diff --git a/methods.go b/methods.go index 772ecf9..3ed61d2 100644 --- a/methods.go +++ b/methods.go @@ -362,13 +362,13 @@ type ( ChatID ChatID `json:"chat_id"` // Latitude of the location - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // Longitude of the location - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // The radius of uncertainty for the location, measured in meters; 0-1500 - HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"` + HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Period in seconds for which the location will be updated (see Live Locations), should be between 60 // and 86400. @@ -407,13 +407,13 @@ type ( InlineMessageID string `json:"inline_message_id,omitempty"` // Latitude of new location - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // Longitude of new location - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // The radius of uncertainty for the location, measured in meters; 0-1500 - HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"` + HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. Heading int `json:"heading,omitempty"` @@ -445,10 +445,10 @@ type ( ChatID ChatID `json:"chat_id"` // Latitude of the venue - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // Longitude of the venue - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // Name of the venue Title string `json:"title"` @@ -1346,7 +1346,7 @@ func (b Bot) SendMediaGroup(p SendMediaGroup) ([]*Message, error) { return result, nil } -func NewLocation(chatID ChatID, latitude, longitude float32) SendLocation { +func NewLocation(chatID ChatID, latitude, longitude float64) SendLocation { return SendLocation{ ChatID: chatID, Latitude: latitude, @@ -1369,7 +1369,7 @@ func (b Bot) SendLocation(p SendLocation) (*Message, error) { return result, nil } -func NewLiveLocation(latitude, longitude float32) EditMessageLiveLocation { +func NewLiveLocation(latitude, longitude float64) EditMessageLiveLocation { return EditMessageLiveLocation{ Latitude: latitude, Longitude: longitude, @@ -1406,11 +1406,11 @@ func (b Bot) StopMessageLiveLocation(p StopMessageLiveLocation) (*Message, error return result, nil } -func NewVenue(chatID ChatID, latitude, longitude float32, title, address string) SendVenue { +func NewVenue(chatID ChatID, lat, long float64, title, address string) SendVenue { return SendVenue{ ChatID: chatID, - Latitude: latitude, - Longitude: longitude, + Latitude: lat, + Longitude: long, Title: title, Address: address, } diff --git a/stickers.go b/stickers.go index 5ac98f8..dfa27a1 100644 --- a/stickers.go +++ b/stickers.go @@ -66,13 +66,13 @@ type ( Point string `json:"point"` // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. - XShift float32 `json:"x_shift"` + XShift float64 `json:"x_shift"` // Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. - YShift float32 `json:"y_shift"` + YShift float64 `json:"y_shift"` // Mask scaling coefficient. For example, 2.0 means double size. - Scale float32 `json:"scale"` + Scale float64 `json:"scale"` } // SendStickerParameters represents data for SetSticker method. diff --git a/types.go b/types.go index 2565ee8..f85d315 100644 --- a/types.go +++ b/types.go @@ -480,13 +480,13 @@ type ( // Location represents a point on the map. Location struct { // Longitude as defined by sender - Longitude float32 `json:"longitude"` + Longitude float64 `json:"longitude"` // Latitude as defined by sender - Latitude float32 `json:"latitude"` + Latitude float64 `json:"latitude"` // The radius of uncertainty for the location, measured in meters; 0-1500 - HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"` + HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Time relative to the message sending date, during which the location can be updated, in seconds. // For active live locations only.