Skip to content

Conversation

tklauser
Copy link
Member

The Go standard library provides types for atomic access since Go 1.19, see https://go.dev/doc/go1.19#atomic_types and
https://pkg.go.dev/sync/atomic#pkg-types.

These make working with atomically accessed variables type-safe and more ergonomic.

This change also allows to get rid of the go.uber.org/atomic dependency.

@tklauser tklauser requested a review from a team as a code owner June 18, 2025 12:12
@tklauser tklauser requested a review from olsajiri June 18, 2025 12:12
@tklauser tklauser added the release-note/misc This PR makes changes that have no direct user impact. label Jun 18, 2025
@tklauser tklauser force-pushed the pr/tklauser/atomic-cleanups branch from 673a3ac to 570e2e6 Compare June 18, 2025 12:35
The Go standard library provides types for atomic access since Go 1.19,
see https://go.dev/doc/go1.19#atomic_types and
https://pkg.go.dev/sync/atomic#pkg-types.

These make working with atomically accessed variables type-safe and more
ergonomic.

This change also allows to get rid of the go.uber.org/atomic dependency.

Signed-off-by: Tobias Klauser <[email protected]>
Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

I love the that we are removing those deps in favor of the stdlib! Next victim is go.uber.org/multierr maybe! :)

@tklauser tklauser force-pushed the pr/tklauser/atomic-cleanups branch from 570e2e6 to c9c5761 Compare June 18, 2025 12:50
@tklauser
Copy link
Member Author

I love the that we are removing those deps in favor of the stdlib! Next victim is go.uber.org/multierr maybe! :)

Yeah, multierr should be easy enough. I'll have a look 👀

@tklauser tklauser requested a review from mtardy June 18, 2025 12:52
@mtardy
Copy link
Member

mtardy commented Jun 18, 2025

I love the that we are removing those deps in favor of the stdlib! Next victim is go.uber.org/multierr maybe! :)

Yeah, multierr should be easy enough. I'll have a look 👀

I think the only downside is that errors don't exactly look the same, I think we took a look at it in the past and there was something like one was going to the line and not the other when logging or something...

Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

I love it! Thank you!

@mtardy mtardy removed the request for review from olsajiri June 18, 2025 12:59
@mtardy mtardy merged commit 3f9d30f into cilium:main Jun 18, 2025
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants