Remove methods duplicated in `go1.19` `sync/atomic`
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 116
- Avg merge
- 7d 10h
- Merged PRs (30d)
- 4
Description
Since the go1.19 update, there are lots of duplicate functionality between this package and sync/atomic. This duplication is currently needed because go1.18 is still supported.
sync/atomic has the following types that are duplicated here:
BoolInt32Int64Pointer[T]Uint32Uint64Uintptr
All types in sync/atomic have the following methods:
CompareAndSwapLoadStoreSwap
Integer-like types have the following, in addition to the above:
Add
But there is still some functionality in here go.uber.org/atomic that is not there in sync/atomic.
All thing considered, after go1.18 becomes unsupported, we could do the following:
- Update
gen-atomicintto embedsync/atomictypes. Only the following additional methods
need to be kept.
-CAS(Deprecated)
-Dec
-Inc
-Sub
-String
-MarshallJSON
-UnmarshallJSON - Update
Boolto embedsync/atomictype. Only the following additional methods
need to be kept.
-CAS(Deprecated)
-String
-Toggle
-MarshallJSON
-UnmarshallJSON - Update
Pointer[T]to embedsync/atomictype.
I just wanted to document all this stuff before I forget.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the gen-atomicint entry point and review the existing Bool and Pointer[T] implementations alongside the generated atomic integer types. Compare their methods with the Go 1.19 sync/atomic types. Done means the duplicated methods are provided through embedded sync/atomic types while the listed additional methods remain available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100