Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pointer[T] #116

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Add Pointer[T] #116

merged 2 commits into from
Aug 9, 2022

Conversation

abhinav
Copy link
Collaborator

@abhinav abhinav commented Aug 9, 2022

Adds a Pointer[T] type that provide the same functionality as
Go 1.19's sync/atomic.Pointer[T] in both, Go 1.18 and 1.19.

In Go 1.19, this uses the standard library's implementation,
and in 1.18 our own custom implementation based on UnsafePointer.
For Go 1.17, even though it's now unsupported, this is a no-op.

Refs GO-1572
Resolves #115

@abhinav abhinav changed the base branch from master to abg/no-ioutil August 9, 2022 21:25
@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Merging #116 (ab44100) into master (d144bb6) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #116   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        22    +2     
  Lines          215       231   +16     
=========================================
+ Hits           215       231   +16     
Impacted Files Coverage Δ
pointer_go118.go 100.00% <100.00%> (ø)
pointer_go119.go 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Base automatically changed from abg/no-ioutil to master August 9, 2022 21:30
This is necessary to use generics.
Adds a Pointer[T] type that provide the same functionality as
Go 1.19's `sync/atomic.Pointer[T]` in both, Go 1.18 and 1.19.

In Go 1.19, this uses the standard library's implementation,
and in 1.18 our own custom implementation based on UnsafePointer.

Refs GO-1572
Resolves #115
@abhinav abhinav merged commit 2ab21d8 into master Aug 9, 2022
@abhinav abhinav deleted the abg/ptr branch August 9, 2022 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatible with atomic.Pointer with golang 1.19
2 participants