Skip to content

Modernize Go code with go fix - #916

Merged
Quim Muntal (qmuntal) merged 2 commits into
mainfrom
chore/go-fix-modernizations
Aug 26, 2026
Merged

Modernize Go code with go fix#916
Quim Muntal (qmuntal) merged 2 commits into
mainfrom
chore/go-fix-modernizations

Conversation

@qmuntal

Copy link
Copy Markdown
Member

Summary

  • apply go fix across the repository
  • adopt current standard-library and language simplifications
  • preserve existing behavior while reducing boilerplate

Testing

  • go test ./...

@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner August 26, 2026 09:36
Copilot AI lite review requested due to automatic review settings August 26, 2026 09:36
@github-actions github-actions Bot added area:agent Changes files in the agent area area:examples Changes files in the examples area area:internal Changes files in the internal area area:provider Changes files in the provider area area:provider/a2a Changes files in the provider / a2a area area:provider/agui Changes files in the provider / agui area area:provider/copilot Changes files in the provider / copilot area area:provider/otel Changes files in the provider / otel area area:tooling Changes files in the tooling area area:workflow Changes files in the workflow area size:xlarge More than 300 changed lines or 10 files labels Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Applies go fix-style modernizations across the repo, adopting newer standard-library helpers and language constructs to reduce boilerplate while aiming to preserve behavior.

Changes:

  • Replace manual map-copy loops and map collection with maps.Copy / maps.Collect.
  • Modernize loops and string processing with newer helpers (e.g., for i := range N, strings.CutPrefix, strings.SplitSeq, slices.Backward, slices.Contains).
  • Update concurrency patterns in tests/utility code using newer WaitGroup helpers (e.g., wg.Go).
Show a summary per file
File Description
workflow/internal/workflowtest/recording_tracer.go Uses maps.Copy to simplify trace-context copying.
workflow/internal/execution/inputwaiter_test.go Modernizes fixed-count loop with range over an integer.
workflow/internal/execution/edgerunner_observability_test.go Uses newer WaitGroup helper and newer pointer creation patterns in tests.
workflow/inproc/events_test.go Modernizes goroutine-spawning loop with integer range.
workflow/inproc/checkpoint_test.go Updates integer loops, uses atomic.Int64, and modernizes goroutine WaitGroup handling.
workflow/inproc/binding_test.go Uses slices.Contains for containment assertion.
workflow/executor.go Replaces manual map copy with maps.Copy for state snapshot/restore.
workflow/builder_test.go Uses slices.Contains for trace assertion.
workflow/agentworkflow/hosting_test.go Modernizes loop style.
workflow/agentworkflow/groupchat.go Uses strings.CutPrefix to simplify prefix handling.
provider/otelprovider/otel_test.go Modernizes fixed-count loops with integer range.
provider/copilotprovider/copilot.go Modernizes pointer helpers and adopts newer stdlib helpers (e.g., maps).
provider/copilotprovider/copilot_test.go Updates tests to use newer pointer helpers and related config setup.
provider/copilotprovider/copilot_internal_test.go Updates tests to use newer pointer helpers for SDK fields.
provider/aguiprovider/hosting_test.go Uses strings.SplitSeq for streaming iteration over lines.
provider/a2aprovider/a2a_test.go Modernizes fixed-count loop with integer range.
internal/jsonx/jsonx_test.go Uses reflect.TypeFor[T]() instead of reflect.TypeOf.
internal/hashmap/hashmap_test.go Uses maps.Collect to build a map from an iterator.
internal/concurrent/map_test.go Uses maps.Collect to build a map from an iterator.
internal/azaiprojects/toolbox_name_test.go Removes now-unnecessary loop-variable rebinding in parallel subtests.
examples/03-workflows/shared-states/main.go Uses strings.SplitSeq to avoid allocating full split slices.
examples/03-workflows/concurrent/map_reduce/main.go Uses strings.SplitSeq for split iteration in reducers/preprocessing.
examples/02-agents/a2a/as_function_tools/main.go Removes now-unnecessary loop-variable rebinding.
cmd/verifyexamples/orchestrator.go Uses newer WaitGroup helper for running example verification goroutines.
cmd/verifyexamples/example_sets.go Removes now-unnecessary loop-variable rebinding when taking addresses.
cmd/prfromissue/parse.go Uses strings.Cut for simpler substring extraction.
agent/skills/fsskills/source_script_test.go Uses slices.Contains for containment check.
agent/middleware.go Uses slices.Backward to iterate middlewares in reverse order.
agent/history_test.go Modernizes loop style while preserving indexed goroutine pattern.
agent/harness/todo/todo_test.go Modernizes fixed-count loop with integer range.
agent/harness/agentmode/agentmode_test.go Modernizes fixed-count loop with integer range.
agent/compaction/toolresult.go Replaces manual clamp with max() usage.
agent/compaction/index.go Uses slices.Backward for reverse traversal and reverse search.
agent/compaction/contextwindow_test.go Modernizes loops with integer range.
agent/compaction/compaction_test.go Modernizes loops with integer range.
agent/agent_test.go Modernizes fixed-count loop with integer range.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 36/36 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread agent/compaction/index.go
Comment thread agent/middleware.go
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Aug 26, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

API Consistency Review

Scope: internal-only
Changed Go contract: None — this PR applies go fix and standard-library modernizations (e.g., slices, maps, errors package idioms) with no new or changed exported APIs, options, or observable runtime behavior.
Upstream evidence reviewed: No equivalent needed; no public API surface changed.
Result: out of scope

No cross-repo parity issues. The parity-approved label is retained.

Generated by Go API Consistency Review Agent for #916 · sonnet46 · 8.83 AIC · ⌖ 4.61 AIC · ⊞ 6.4K ·

@github-actions github-actions Bot added kind:code Changes production behavior or code kind:examples Changes examples or example-support metadata kind:tests Changes tests, fixtures, or test infrastructure pending-auto-risk Automatic risk classification is in progress risk:low Limited blast radius and straightforward rollback and removed pending-auto-risk Automatic risk classification is in progress labels Aug 26, 2026
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit 8c8544a Aug 26, 2026
36 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the chore/go-fix-modernizations branch August 26, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Changes files in the agent area area:examples Changes files in the examples area area:internal Changes files in the internal area area:provider/a2a Changes files in the provider / a2a area area:provider/agui Changes files in the provider / agui area area:provider/copilot Changes files in the provider / copilot area area:provider/otel Changes files in the provider / otel area area:provider Changes files in the provider area area:tooling Changes files in the tooling area area:workflow Changes files in the workflow area kind:code Changes production behavior or code kind:examples Changes examples or example-support metadata kind:tests Changes tests, fixtures, or test infrastructure parity-approved Go API consistency review found no parity issues risk:low Limited blast radius and straightforward rollback size:xlarge More than 300 changed lines or 10 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants