Skip to content

🧹 Modernize arista and network providers with Go idioms#6891

Merged
tas50 merged 4 commits intomainfrom
tsmith/cleanup-arista-network-providers
Mar 17, 2026
Merged

🧹 Modernize arista and network providers with Go idioms#6891
tas50 merged 4 commits intomainfrom
tsmith/cleanup-arista-network-providers

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 12, 2026

Summary

  • Use strings.Builder instead of string concatenation in arista GetSection and network httpHeaderContentType.id()
  • Use errgroup.Go() instead of manual Add(1)/go func()/defer Done() in dnsshake and tlsshake
  • Use maps.Copy instead of manual for-range loops in tlsshake cipher init
  • Remove redundant // +build debugtest tag (Go 1.17+ only needs //go:build)

Test plan

  • make test/lint passes
  • go test ./providers/arista/... passes
  • go test ./providers/network/... passes
  • CI green

🤖 Generated with Claude Code

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Modernization cleanup using Go 1.25 idioms; no user-facing behavior changes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

Test Results

5 481 tests   5 477 ✅  2m 4s ⏱️
  410 suites      4 💤
   31 files        0 ❌

Results for commit d26bb1a.

♻️ This comment has been updated with latest results.

mondoo-code-review[bot]

This comment was marked as resolved.

tas50 and others added 3 commits March 17, 2026 10:51
Use strings.Builder for string concatenation, errgroup.Go() instead of
manual Add/Done, maps.Copy for map merging, and remove redundant +build tag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use separate WriteByte/WriteString calls instead of concatenating
strings inside WriteString, per review feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sync.WaitGroup has no Go() method. Switch to errgroup.Group which
provides the Go(func() error) API the code expects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tas50 tas50 force-pushed the tsmith/cleanup-arista-network-providers branch from 03b10e7 to 2d7eb52 Compare March 17, 2026 17:57
@mondoo-code-review mondoo-code-review bot dismissed their stale review March 17, 2026 17:57

Superseded by new review

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Safe modernization of Go idioms with no behavioral changes, but errgroup usage discards errors that should be collected.

errgroup doesn't fit here: closures collect multiple errors via
multierr.Errors, not fail-fast. Keep sync.WaitGroup with proper
Add(1)/go func()/defer Done() pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Clean revert from errgroup to sync.WaitGroup with proper manual synchronization.

@tas50 tas50 merged commit 086526f into main Mar 17, 2026
22 checks passed
@tas50 tas50 deleted the tsmith/cleanup-arista-network-providers branch March 17, 2026 19:07
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant