Skip to content

chore: run go fix#3080

Merged
julienrbrt merged 1 commit intomainfrom
julien/go-fix
Feb 18, 2026
Merged

chore: run go fix#3080
julienrbrt merged 1 commit intomainfrom
julien/go-fix

Conversation

@julienrbrt
Copy link
Member

Run new Go 1.26.0 go fix.

@claude
Copy link
Contributor

claude bot commented Feb 18, 2026

Claude finished @julienrbrt's task in 1m 46s —— View job


Code Review

  • Gather context and analyze the diff
  • Review changed files for correctness
  • Verify changes are consistent with go fix output
  • Post review findings

This PR applies automatic modernizations via go fix targeting Go 1.26. The changes are mechanical and correct. Here's a breakdown by category:

1. Range-over-integer (for i := 0; i < N; i++for i := range N)

Introduced in Go 1.22. All conversions are correct. Both forms — for i := range N (when i is used) and for range N (when i is not used) — are applied appropriately throughout the codebase.

Goroutine closure safety: In pkg/da/selector_test.go:72-80, the loop variable i is captured correctly — it's passed explicitly as a function argument (i * numCallsPerGoroutine), not closed over. No data race introduced.

2. interface{}any

Two instances:

  • pkg/telemetry/testutil/attributes.go: expected interface{}expected any
  • pkg/raft/node.go:309: Apply(...) interface{}Apply(...) any

Both are correct aliases since Go 1.18. The FSM.Apply return type change is safe — the raft.FSM interface accepts any as the return type.

3. fmt.Appendf(nil, ...) replacing []byte(fmt.Sprintf(...))

In block/internal/executing/executor_restart_test.go:319:

// Before
newStateRoot := []byte(fmt.Sprintf("new_root_%d", i+1))
// After
newStateRoot := fmt.Appendf(nil, "new_root_%d", i+1)

Correct and marginally more efficient — avoids an intermediate string allocation.

4. sync.WaitGroup.Go replacing wg.Add(1); go func() { defer wg.Done() }()

In block/internal/syncing/syncer_test.go:921 and :993:

// Before
s.wg.Add(1)
go func() { defer s.wg.Done() }()
// After
s.wg.Go(func() {})

sync.WaitGroup.Go was added in Go 1.25. The module's go.mod declares go 1.25.6, so this is correct. The wg field in syncer is already using wg.Go in production code (syncer.go:239), so this is consistent.

5. Built-in max replacing manual clamping

In tools/db-bench/main.go:126:

// Before
overwriteEvery = int(math.Round(1.0 / cfg.overwriteRatio))
if overwriteEvery < 1 {
    overwriteEvery = 1
}
// After
overwriteEvery = max(int(math.Round(1.0/cfg.overwriteRatio)), 1)

Cleaner. Built-in max available since Go 1.21. Semantically identical.

6. json:"time,omitempty"json:"time" in pkg/da/jsonrpc/header.go

// Before
BlockTime time.Time `json:"time,omitempty"`
// After
BlockTime time.Time `json:"time"`

This is correct and clarifying. In Go's standard encoding/json, omitempty has no effect on struct types (including time.Time) — a zero-value struct is never considered "empty" by the encoder, so the tag was a no-op. Removing it avoids misleading intent. No behavioral change.


Assessment

All changes are mechanical, safe, and correctly applied. No bugs, regressions, or semantic changes introduced. The PR is consistent with what go fix would produce for Go 1.26 modernizations.

LGTM.

@github-actions
Copy link
Contributor

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedFeb 18, 2026, 9:50 AM

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @julienrbrt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on code modernization and adherence to contemporary Go idioms, as suggested by the go fix tool for Go 1.26.0. The changes involve updating loop constructs, simplifying concurrency patterns, and refining type declarations and JSON marshaling tags across various test and utility files. These updates aim to improve code readability, maintainability, and leverage newer language features without altering the functional behavior of the application.

Highlights

  • Go Idiom Modernization: Updated numerous for loops from the traditional for i := 0; i < N; i++ syntax to the more idiomatic for i := range N or for range N where the index i is not explicitly used.
  • Type System Updates: Replaced interface{} with the more concise any type in function signatures, aligning with modern Go syntax.
  • String Formatting Improvement: Replaced fmt.Sprintf with fmt.Appendf in one instance for potentially more efficient string construction.
  • Concurrency Utilities Refinement: Simplified goroutine management by replacing s.wg.Add(1); go func() { defer s.wg.Done() }() with the more streamlined s.wg.Go(func() {}).
  • JSON Tag Adjustment: Modified a JSON struct tag from json:"time,omitempty" to json:"time" to ensure the field is always included during JSON marshaling.
  • Mathematical Expression Simplification: Replaced a conditional check for minimum value (if x < 1 { x = 1 }) with the max function for brevity and clarity.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • block/internal/da/async_block_retriever_test.go
    • Updated for loop to use for range syntax.
  • block/internal/da/client_test.go
    • Modernized multiple for loops to use for i := range syntax.
  • block/internal/executing/executor_restart_test.go
    • Replaced fmt.Sprintf with fmt.Appendf for string formatting.
  • block/internal/submitting/da_submitter.go
    • Updated for loop to use for i := range syntax.
  • block/internal/syncing/da_retriever_test.go
    • Modernized for loop to use for i := range syntax.
  • block/internal/syncing/syncer_benchmark_test.go
    • Updated multiple for loops to use for i := range syntax.
  • block/internal/syncing/syncer_forced_inclusion_test.go
    • Modernized multiple for loops to use for range syntax.
  • block/internal/syncing/syncer_test.go
    • Updated for loop to use for i := range syntax.
    • Simplified goroutine creation using s.wg.Go.
  • node/helpers_test.go
    • Modernized for loop to use for i := range syntax.
  • pkg/da/jsonrpc/header.go
    • Removed omitempty from BlockTime JSON tag.
  • pkg/da/selector_test.go
    • Updated multiple for loops to use for range or for i := range syntax.
  • pkg/p2p/client_test.go
    • Modernized for loop to use for range syntax.
  • pkg/p2p/utils_test.go
    • Updated for loop to use for i := range syntax.
  • pkg/raft/node.go
    • Replaced interface{} with any in the Apply method signature.
  • pkg/rpc/server/da_visualization_test.go
    • Modernized for loop to use for i := range syntax.
  • pkg/sequencers/common/checkpoint_test.go
    • Updated multiple for loops to use for range syntax.
  • pkg/sequencers/single/queue_test.go
    • Modernized multiple for loops to use for i := range or for range syntax.
  • pkg/sequencers/single/sequencer_test.go
    • Updated multiple for loops to use for i := range syntax.
  • pkg/signer/file/file_signer_test.go
    • Modernized multiple for loops to use for i := range syntax.
  • pkg/store/cached_store_test.go
    • Updated multiple for loops to use for i := range syntax.
  • pkg/store/store_adapter_test.go
    • Modernized multiple for loops to use for i := range syntax.
  • pkg/store/store_test.go
    • Updated multiple for loops to use for i := range syntax.
  • pkg/telemetry/testutil/attributes.go
    • Replaced interface{} with any in the RequireAttribute function signature.
  • tools/db-bench/main.go
    • Replaced conditional minimum check with max function.
    • Modernized for loop to use for i := range syntax.
  • tools/local-da/local.go
    • Updated for loop to use for i := range syntax.
  • types/serialization_test.go
    • Modernized for loop to use for range syntax.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@julienrbrt julienrbrt enabled auto-merge February 18, 2026 09:50
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.11%. Comparing base (cf5565e) to head (790ae2d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/raft/node.go 0.00% 1 Missing ⚠️
pkg/telemetry/testutil/attributes.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3080      +/-   ##
==========================================
- Coverage   61.16%   61.11%   -0.06%     
==========================================
  Files         113      113              
  Lines       11444    11444              
==========================================
- Hits         7000     6994       -6     
- Misses       3655     3661       +6     
  Partials      789      789              
Flag Coverage Δ
combined 61.11% <33.33%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request applies automated fixes from go fix for Go 1.26.0. The changes are primarily stylistic and idiomatic, such as updating loop syntax to use for range over integers, replacing interface{} with any, and using more efficient functions like fmt.Appendf and max. All changes appear correct and improve code quality and readability without introducing any issues. The update is well-contained and looks good to merge.

Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

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

Good call 💪

lastStateRoot := initStateRoot
for i := range numBlocks {
newStateRoot := []byte(fmt.Sprintf("new_root_%d", i+1))
newStateRoot := fmt.Appendf(nil, "new_root_%d", i+1)
Copy link
Contributor

Choose a reason for hiding this comment

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

This new syntax will take some time for me to get used to.

@julienrbrt julienrbrt added this pull request to the merge queue Feb 18, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 18, 2026
@julienrbrt julienrbrt merged commit a16e4c9 into main Feb 18, 2026
51 of 52 checks passed
@julienrbrt julienrbrt deleted the julien/go-fix branch February 18, 2026 12:45
alpe added a commit that referenced this pull request Feb 19, 2026
* main:
  chore: run `go fix` (#3080)
  build(deps): Bump the all-go group across 8 directories with 6 updates (#3076)
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.

2 participants

Comments