Skip to content

Fixed modernize issues. - #2195

Merged
alexeykiselev merged 3 commits into
masterfrom
fix-modernize-issues
Aug 26, 2026
Merged

alexeykiselev merged 3 commits into
masterfrom
fix-modernize-issues

Conversation

@alexeykiselev

Copy link
Copy Markdown
Collaborator

No description provided.

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

This PR applies a small modernization/refactor in pkg/proto by replacing manual reflect.New(...).Interface().(T) interface assertions with the newer reflect.TypeAssert[T](...) helper, keeping the same runtime behavior while simplifying the code.

Changes:

  • Replace Interface().(T) assertions with reflect.TypeAssert[T](reflect.Value) for DataEntry, Transaction, and protocol Message construction.
  • Update related tests to use the same reflect.TypeAssert pattern for snapshots and protocol marshalling.

Reviewed changes

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

File Description
pkg/proto/types.go Uses reflect.TypeAssert[DataEntry] when instantiating data entries from reflected types.
pkg/proto/transactions.go Uses reflect.TypeAssert[Transaction] when constructing transactions from reflected types.
pkg/proto/snapshot_types_test.go Updates snapshot test instantiation to use reflect.TypeAssert[proto.AtomicSnapshot].
pkg/proto/proto_test.go Updates protocol marshalling tests to construct Message via reflect.TypeAssert[Message].

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

@alexeykiselev
alexeykiselev merged commit fa0f3ad into master Aug 26, 2026
20 checks passed
@alexeykiselev
alexeykiselev deleted the fix-modernize-issues branch August 26, 2026 10:26

This branch was previously deployed

1 inactive deployment
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.

3 participants