Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync/atomic: document hint in the old APIs to point out that the new named types exist #56495

Closed
uji opened this issue Oct 31, 2022 · 3 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@uji
Copy link
Contributor

uji commented Oct 31, 2022

I posted the proposal of deprecated old APIs of sync/atomic.
ref: #55302

Finally, this proposal was declined, but I think it's better to have a hint to the old APIs to point out and recommend that the new named types exist.

@uji uji added the Proposal label Oct 31, 2022
@gopherbot gopherbot added compiler/runtime Issues related to the Go compiler and/or runtime. Documentation labels Oct 31, 2022
@mknyszek mknyszek changed the title sync/atomic: document hint to the old APIs to point out that the new named types exist. sync/atomic: document hint in the old APIs to point out that the new named types exist Nov 2, 2022
@mknyszek mknyszek added this to the Backlog milestone Nov 2, 2022
@randall77
Copy link
Contributor

Not sure how to actually word this. Suggestions welcome.

// SwapInt32 atomically stores new into *addr and returns the previous *addr value.
// Consider using (*Int32).Swap instead.
func SwapInt32(addr *int32, new int32) (old int32)

Seems kinda lame and not really explanatory. But I don't want to clutter each function doc with lots of exposition either.

@seankhliao
Copy link
Member

"Consider using [Int32] to guard all accesses."

@gopherbot
Copy link

Change https://go.dev/cl/449237 mentions this issue: sync/atomic: hint users of old API to use new type-based API instead

@dmitshur dmitshur modified the milestones: Backlog, Go1.20 Feb 2, 2023
@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 2, 2023
@golang golang locked and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants