Skip to content

Conversation

Jguer
Copy link
Owner

@Jguer Jguer commented Sep 16, 2025

Run go run golang.org/x/tools/gopls /internal/analysis/modernize/cmd/modernize@latest -fix -test ./... to modernize syntax

@Jguer Jguer requested a review from Copilot September 16, 2025 11:20
@Jguer Jguer self-assigned this Sep 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes Go syntax by running the golang.org/x/tools/gopls/internal/analysis/modernize tool to automatically update code to use newer Go language features and idioms.

Key changes include:

  • Removing unnecessary tc := tc range variable captures in parallel test loops (Go 1.22+ no longer requires this)
  • Replacing manual loop-based operations with built-in functions like slices.Contains, min, and maps.Copy
  • Updating interface{} to the shorter any type alias

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sync_test.go Removes unnecessary range variable capture in test loop
print.go Replaces C-style for loop with range-based iteration
pkg/vcs/vcs_test.go Removes unnecessary range variable captures in multiple test functions
pkg/vcs/vcs.go Replaces manual loop with slices.Contains and adds import
pkg/vcs/mock.go Replaces manual loop with slices.Contains and adds import
pkg/upgrade/sources_test.go Removes unnecessary range variable captures in test functions
pkg/upgrade/service_test.go Removes unnecessary range variable capture in test function
pkg/text/text_test.go Removes unnecessary range variable capture in test function
pkg/text/text.go Replaces manual min calculation with built-in min function
pkg/text/service.go Updates interface{} type to any in multiple function calls
pkg/sync/workdir/aur_source_test.go Removes unnecessary range variable capture in test function
pkg/sync/srcinfo/pgp/keys_test.go Removes unnecessary range variable capture in test function
pkg/sync/build/pkg_archive_test.go Replaces range variable capture with comment
pkg/sync/build/installer_test.go Removes unnecessary range variable captures in multiple test functions
pkg/sync/build/installer.go Replaces manual map copying with maps.Copy and adds import
pkg/settings/parser/parser_test.go Removes unnecessary range variable captures in multiple test functions
pkg/settings/parser/parser.go Replaces manual map copying with maps.Copy and adds import
pkg/settings/exe/mock.go Updates struct field types and function parameters from interface{} to any
pkg/query/query_builder.go Updates map value types from interface{} to any
pkg/news/news_test.go Removes unnecessary range variable capture in test function
pkg/intrange/intrange_test.go Removes unnecessary range variable captures in test functions
pkg/download/aur_test.go Removes unnecessary range variable capture in test function
pkg/download/abs_test.go Removes unnecessary range variable captures in test functions
pkg/dep/topo/dep.go Replaces manual map copying with maps.Copy and adds import
pkg/dep/dep_graph.go Removes unnecessary range variable captures in nested loops
pkg/db/types.go Replaces manual loop with slices.Contains and adds import
pkg/db/ialpm/alpm.go Updates function parameter types from interface{} to any
local_install_test.go Replaces manual loop with slices.Contains and adds import

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant