aboutsummaryrefslogtreecommitdiff
path: root/geo/geo.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 15:52:02 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 15:52:02 +0200
commitd25c2cba801cbaa9f9c0d5a92b90f153630ffe24 (patch)
tree8fc2672984dde4a621944839b951a478bb87460a /geo/geo.go
parent5b1962f13809f4306b50536a2105252a71b5d74f (diff)
Upgrade to Go 1.27 and apply go fix modernization
Diffstat (limited to 'geo/geo.go')
-rw-r--r--geo/geo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/geo/geo.go b/geo/geo.go
index 0fcff14..50ac4c7 100644
--- a/geo/geo.go
+++ b/geo/geo.go
@@ -14,7 +14,7 @@ func DistanceM(a, b geodist.Coord) float64 {
func Nearest(coords []geodist.Coord, target geodist.Coord) (int, float64) {
bestIndex := 0
bestDistance := math.Inf(1)
- for index := 0; index < len(coords); index++ {
+ for index := range coords {
distance := DistanceM(coords[index], target)
if distance < bestDistance {
bestIndex = index