go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

AtomicXXX type consideration

Open anyoptional opened this issue 1 year ago • 1 comments

Currently, syncx package defines atomic types like following:

type AtomicBool uint32
type AtomicDuration int64
type AtomicFloat64 uint64

In this way, we cannot prohibit developers from using them as non-atomic types. Isn't it better to define it like this?

type AtomicBool struct {
    state uint32
}

anyoptional avatar Aug 04 '22 13:08 anyoptional

I think it's a good idea.

kevwan avatar Aug 06 '22 09:08 kevwan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 07 '23 01:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Mar 18 '24 01:03 github-actions[bot]