open-feature / go-sdk

Go SDK for OpenFeature
https://openfeature.dev
Apache License 2.0
144 stars 33 forks source link

refactor: write [T]Value in terms of [T]ValueDetails #224

Closed craigpastro closed 1 year ago

craigpastro commented 1 year ago

This PR

Rewrite all the [T]Value functions in terms of [T]ValueDetails functions to reduce duplication. [T]ValueDetails is not anything significantly much more than [T]Details.

By the way, I noticed this while I was looking at the code to see if it could be genericizied (#158) and it seems like it can, but it is a bit tricky I think.

Related Issues

Notes

Follow-up Tasks

How to test

craigpastro commented 1 year ago

🤔 GitHub action test failed twice I see because of

Error: Unable to resolve action `codecov/codecov-action@v4`, unable to find version `v4`

Try a downgrade to stable v3?

codecov[bot] commented 1 year ago

Codecov Report

Merging #224 (7693bbd) into main (e2b3586) will increase coverage by 2.85%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
+ Coverage   78.76%   81.61%   +2.85%     
==========================================
  Files          10       10              
  Lines        1210     1142      -68     
==========================================
- Hits          953      932      -21     
+ Misses        230      192      -38     
+ Partials       27       18       -9     
Files Coverage Δ
pkg/openfeature/client.go 76.76% <100.00%> (+6.31%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

beeme1mr commented 1 year ago

Hey @craigpastro, yeah it looks like CodeCov prematurely released v4, and Renovate updated it.

https://github.com/codecov/codecov-action/issues/1089

I've reverted CodeCov back to v3.

craigpastro commented 1 year ago

Hey @craigpastro, yeah it looks like CodeCov prematurely released v4, and Renovate updated it.

codecov/codecov-action#1089

I've reverted CodeCov back to v3.

Thanks @beeme1mr 🙌

toddbaert commented 1 year ago

I'll try to review this today/tomorrow!

craigpastro commented 1 year ago

Thanks, Todd. No rush of course.