Skip to content

Commit a3670a4

Browse files
committed
Fix: QF1004: could use strings.ReplaceAll instead
1 parent bee9b00 commit a3670a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ func downloadTile(ctx context.Context, msgChan chan<- WSMessage, tile Tile, mapS
406406

407407
// Construct the URL for the tile.
408408
subdomain := []string{"a", "b", "c"}[rand.Intn(3)]
409-
url := strings.Replace(mapStyle, "{s}", subdomain, -1)
410-
url = strings.Replace(url, "{z}", fmt.Sprintf("%d", tile.Z), -1)
411-
url = strings.Replace(url, "{x}", fmt.Sprintf("%d", tile.X), -1)
412-
url = strings.Replace(url, "{y}", fmt.Sprintf("%d", tile.Y), -1)
409+
url := strings.ReplaceAll(mapStyle, "{s}", subdomain)
410+
url = strings.ReplaceAll(url, "{z}", fmt.Sprintf("%d", tile.Z))
411+
url = strings.ReplaceAll(url, "{x}", fmt.Sprintf("%d", tile.X))
412+
url = strings.ReplaceAll(url, "{y}", fmt.Sprintf("%d", tile.Y))
413413

414414
var err error
415415
for attempt := 0; attempt < maxRetries; attempt++ {

0 commit comments

Comments
 (0)