frostdb icon indicating copy to clipboard operation
frostdb copied to clipboard

Replace atomic unsafe pointers with generic atomic pointers

Open Mihai22125 opened this issue 2 years ago • 4 comments

Replace atomic unsafe pointers with generic atomic pointers.

First-time contributor, so any feedback is more than welcome!

This resolves: #157.

Mihai22125 avatar Aug 12 '22 18:08 Mihai22125

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 12 '22 18:08 CLAassistant

This looks great! Thanks for the contribution

thorfour avatar Aug 12 '22 18:08 thorfour

Looks like we need to upgrade to go1.19, do you mind taking care of that @Mihai22125?

brancz avatar Aug 12 '22 18:08 brancz

Sure thing

Mihai22125 avatar Aug 12 '22 18:08 Mihai22125

Error: sync/atomic is in the blacklist: Use go.uber.org/atomic instead of sync/atomic (depguard)

Looks like its necessary to update the .golangci.yml file

thorfour avatar Aug 16 '22 15:08 thorfour

Hi @thorfour, Thanks for the point.

I updated the .golangci.yml file. Can you check if it's alright now?

Mihai22125 avatar Aug 16 '22 19:08 Mihai22125

   Error: copylocks: NewPartList passes lock by value: sync/atomic.Pointer[github.com/polarsignals/frostdb.Node] contains sync/atomic.noCopy (govet)
  Error: copylocks: literal copies lock value from next: sync/atomic.Pointer[github.com/polarsignals/frostdb.Node] contains sync/atomic.noCopy (govet)
  Error: copylocks: call of NewPartList copies lock value: sync/atomic.Pointer[github.com/polarsignals/frostdb.Node] contains sync/atomic.noCopy (govet)
  Error: copylocks: literal copies lock value from index: sync/atomic.Pointer[github.com/google/btree.BTree] contains sync/atomic.noCopy (govet)

Now it's mad about copying locks

thorfour avatar Aug 16 '22 19:08 thorfour

The errors should be fixed now, please let me know if there are any issues left.

Mihai22125 avatar Aug 17 '22 20:08 Mihai22125

Closing in favor of https://github.com/polarsignals/frostdb/pull/203 thanks for the contribution @Mihai22125

thorfour avatar Sep 22 '22 09:09 thorfour

Hi! I'm glad I could help

Mihai22125 avatar Sep 22 '22 13:09 Mihai22125