From bfd0e3f3c27b9acf02e4cbdda9796c49dfb2b6c3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 20 Aug 2026 14:48:47 +0100 Subject: [PATCH] build: modernize with "go fix -mapsloop": use maps.Copy --- backend/iclouddrive/api/photos.go | 5 ++--- backend/oracleobjectstorage/client_test.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/iclouddrive/api/photos.go b/backend/iclouddrive/api/photos.go index a661b09e1..f88a5c8ad 100644 --- a/backend/iclouddrive/api/photos.go +++ b/backend/iclouddrive/api/photos.go @@ -8,6 +8,7 @@ import ( "encoding/json" "errors" "fmt" + "maps" "net/http" "os" "path" @@ -1617,9 +1618,7 @@ func (ps *PhotosService) GetLibraryAlbumCounts(ctx context.Context) (map[string] if err := ps.requestForArea(ctx, area, "internal/records/query/batch", map[string]any{"batch": batch}, &response); err != nil { return nil, fmt.Errorf("failed to get library album counts: %w", err) } - for k, v := range response.toCounts(order) { - counts[k] = v - } + maps.Copy(counts, response.toCounts(order)) } return counts, nil } diff --git a/backend/oracleobjectstorage/client_test.go b/backend/oracleobjectstorage/client_test.go index 9ef5c2068..3fa33ea1e 100644 --- a/backend/oracleobjectstorage/client_test.go +++ b/backend/oracleobjectstorage/client_test.go @@ -10,6 +10,7 @@ import ( "encoding/base64" "encoding/hex" "io" + "maps" "net/http" "net/http/httptest" "strconv" @@ -62,9 +63,7 @@ func TestGzipEncoding(t *testing.T) { "namespace": "test", "endpoint": srv.URL, } - for k, v := range extraConfig { - m[k] = v - } + maps.Copy(m, extraConfig) fsInfo, err := NewFs(ctx, "TestOOSGzip", "bucket", m) require.NoError(t, err) return fsInfo.(*Fs)