mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
plugin/geoip: cleanup code (#5009)
remove unnecessary float64 convert and clean code Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
This commit is contained in:
@@ -39,11 +39,11 @@ func (g GeoIP) setCityMetadata(ctx context.Context, data *geoip2.City) {
|
||||
return continentCode
|
||||
})
|
||||
|
||||
latitude := strconv.FormatFloat(float64(data.Location.Latitude), 'f', -1, 64)
|
||||
latitude := strconv.FormatFloat(data.Location.Latitude, 'f', -1, 64)
|
||||
metadata.SetValueFunc(ctx, pluginName+"/latitude", func() string {
|
||||
return latitude
|
||||
})
|
||||
longitude := strconv.FormatFloat(float64(data.Location.Longitude), 'f', -1, 64)
|
||||
longitude := strconv.FormatFloat(data.Location.Longitude, 'f', -1, 64)
|
||||
metadata.SetValueFunc(ctx, pluginName+"/longitude", func() string {
|
||||
return longitude
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user