Skip to content

Remove methods duplicated in go1.19 sync/atomic #119

@eNV25

Description

@eNV25

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:

  • Bool
  • Int32
  • Int64
  • Pointer[T]
  • Uint32
  • Uint64
  • Uintptr

All types in sync/atomic have the following methods:

  • CompareAndSwap
  • Load
  • Store
  • Swap

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-atomicint to embed sync/atomic types. Only the following additional methods
    need to be kept.
    - CAS (Deprecated)
    - Dec
    - Inc
    - Sub
    - String
    - MarshallJSON
    - UnmarshallJSON
  • Update Bool to embed sync/atomic type. Only the following additional methods
    need to be kept.
    - CAS (Deprecated)
    - String
    - Toggle
    - MarshallJSON
    - UnmarshallJSON
  • Update Pointer[T] to embed sync/atomic type.

I just wanted to document all this stuff before I forget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions