From 939551f662c12d0067c6952cc7dc036fa713a506 Mon Sep 17 00:00:00 2001 From: Su Yang Date: Fri, 5 Jan 2024 21:45:34 +0800 Subject: [PATCH] fix: fix G601, Implicit memory aliasing in for loop. --- internal/pages/home/bookmark.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pages/home/bookmark.go b/internal/pages/home/bookmark.go index 6ce955b..50d53bd 100644 --- a/internal/pages/home/bookmark.go +++ b/internal/pages/home/bookmark.go @@ -38,7 +38,8 @@ func GenerateBookmarkTemplate(filter string) template.HTML { if len(bookmarksData.Categories) > 0 { defaultCategory := bookmarksData.Categories[0] for _, category := range bookmarksData.Categories { - tpl += renderBookmarksWithCategories(&bookmarks, &category, &defaultCategory, options.OpenBookmarkNewTab, options.EnableEncryptedLink, options.IconMode) + categoryCopy := category + tpl += renderBookmarksWithCategories(&bookmarks, &categoryCopy, &defaultCategory, options.OpenBookmarkNewTab, options.EnableEncryptedLink, options.IconMode) } } else { tpl += renderBookmarksWithoutCategories(&bookmarks, options.OpenBookmarkNewTab, options.EnableEncryptedLink, options.IconMode)