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

field: nil check Numeric, String, Composite, etc accessors #196

Merged
merged 3 commits into from
Sep 26, 2022

Conversation

adamdecaf
Copy link
Member

Issue: #195

@codecov-commenter
Copy link

Codecov Report

Base: 71.21% // Head: 71.30% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (3940453) compared to base (68aee25).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #196      +/-   ##
==========================================
+ Coverage   71.21%   71.30%   +0.08%     
==========================================
  Files          40       40              
  Lines        1845     1847       +2     
==========================================
+ Hits         1314     1317       +3     
+ Misses        340      339       -1     
  Partials      191      191              
Impacted Files Coverage Δ
field/string.go 77.33% <100.00%> (+1.99%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@alovak
Copy link
Contributor

alovak commented Sep 22, 2022

This is a really good change to make code simpler for the callers

@adamdecaf
Copy link
Member Author

@alovak Cool. I can add this to every field type.

@adamdecaf adamdecaf marked this pull request as ready for review September 23, 2022 13:42
@alovak
Copy link
Contributor

alovak commented Sep 23, 2022

thanks @adamdecaf! this PR looks 💪

the only thing that (kind of) worries me is that GetValue. On message we have GetString(), GetBytes(). But on field we have String() and Bytes() and now we add GetValue().

We can introduce a breaking change by adding Value() and SetValue() and renaming Value into value. It will make code more consistent and safe. In my personal opinion, such change is just find/replace so it should not be a PITA.

thoughts?

@adamdecaf
Copy link
Member Author

Yea I agree that GetValue() isn't idea and I'm okay with that breaking change. It's minor enough and increases runtime safety.

@adamdecaf
Copy link
Member Author

@alovak feel free to merge this whenever you want. I know there are other 8583 changes in flight.

@alovak alovak merged commit c45c72b into master Sep 26, 2022
@alovak alovak deleted the nil-check-fields branch September 26, 2022 11:34
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.

3 participants