Replace go.uber.org/atomic with sync/atomic#910
Conversation
|
|
||
| func (r *Relayer) decrementPending() { | ||
| r.pending.Dec() | ||
| r.pending.Add(^uint32(0)) |
There was a problem hiding this comment.
| r.pending.Add(^uint32(0)) | |
| r.pending.Add(-1) |
right?
There was a problem hiding this comment.
Unfortunately pending is unsigned, & there's no atomic subtract method, so this is the documented way: https://pkg.go.dev/sync/atomic#AddUint32
Added comment linking to docs
| customAppHeaderExpectedValue = "simpsons" | ||
| ) | ||
| var customAppHeaderValue atomic.String | ||
| var customAppHeaderValue atomic.Pointer[string] |
There was a problem hiding this comment.
a pity they don't just support strings.
There was a problem hiding this comment.
Or at least a generic Value[T]. Since these strings are only used in tests I opted not to create a utility struct wrapping atomic.Value
|
thanks for the contribution! Out of curiosity, are you using this library anywhere? |
|
It's a transitive dependency through https://temporal.io, which https://peerdb.io (data movement product) is built on top of |
|
@rabbbit who's the decision maker for merging? |
sorry for the lack of movement on this. the service mesh team at Uber is currently the de facto maintainers of this repo. can you shed light on how you're using tchannel-go? |
rely on it via temporal |
|
@cinchurge is there anything I can do to help merge this? |
go 1.19 introduced atomic types
https://tip.golang.org/doc/go1.19#atomic_types
Indirect dependency remains through multierr,
but multierr recently dropped its go.uber.org/atomic dependency: uber-go/multierr#72