Skip to content

chore(lint): enable modernize linter and apply suggested refactorings - #387

Open
dongjiang1989 wants to merge 1 commit into
a2aproject:mainfrom
dongjiang1989:add-modernize-linter
Open

chore(lint): enable modernize linter and apply suggested refactorings#387
dongjiang1989 wants to merge 1 commit into
a2aproject:mainfrom
dongjiang1989:add-modernize-linter

Conversation

@dongjiang1989

@dongjiang1989 dongjiang1989 commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Enable the modernize linter in .golangci.yml and apply the refactorings it suggests across the codebase.

Changes

  • .golangci.yml: enable modernize in the linter list; also fix missing trailing newline.
  • a2acompat/a2av0/migration.go: replace manual map copy loop with maps.Collect.
  • a2acompat/a2av0/rest_compat_test.go: replace strings.HasPrefix + strings.TrimPrefix pair with strings.CutPrefix.
  • a2asrv/eventqueue/manager_in_memory_impl_test.go and a2asrv/push/store_test.go: replace for i := 0; i < n; i++ with for i := range n.
  • a2asrv/taskstore/inmemory.go and a2asrv/taskstore/store_test.go: replace []byte(fmt.Sprintf(...)) with fmt.Appendf(nil, ...).

Verification

  • go vet ./... — clean
  • golangci-lint run ./... — 0 issues
  • go test -count=1 ./... — all 29 packages pass

Signed-off-by: dongjiang <dongjiang1989@126.com>
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