Skip to content

refactor: modernize sync/atomic usage with typed atomic apis#5460

Open
purelualight wants to merge 1 commit into
hyperledger:mainfrom
purelualight:main
Open

refactor: modernize sync/atomic usage with typed atomic apis#5460
purelualight wants to merge 1 commit into
hyperledger:mainfrom
purelualight:main

Conversation

@purelualight
Copy link
Copy Markdown

Type of change

  • Improvement (improvement to code, performance, etc)

Description

Replace legacy sync/atomic function-based API (AddInt32, LoadInt32, etc.)
with Go 1.19+ typed atomic types (atomic.Int32, atomic.Int64, etc.).

This change:

  • Improves code readability by removing explicit address-of operators
  • Enhances type safety at compile-time
  • Provides better API ergonomics with method-based access
  • Aligns with modern Go best practices (More info sync/atomic: add typed atomic values golang/go#50860)

The transformation is source-compatible and requires Go 1.19 or later.

Additional details

Related issues

@purelualight purelualight requested a review from a team as a code owner April 23, 2026 14:11
Signed-off-by: purelualight <purelualight@outlook.com>
@purelualight
Copy link
Copy Markdown
Author

@pfi79 Hi, Could you please review this PR at your convenience? Thank you very much.

@pfi79
Copy link
Copy Markdown
Contributor

pfi79 commented May 11, 2026

Can you provide a link to the documentation where it would be highly recommended?

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