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

Return bool from XXXOf functions #18

Merged
merged 2 commits into from Jan 21, 2019
Merged

Return bool from XXXOf functions #18

merged 2 commits into from Jan 21, 2019

Conversation

morikuni
Copy link
Owner

Changes

XXXOf functions also return bool value.
Return true if data exists, false if no data exists.

Affected functions.

  • CodeOf
  • MessageOf
  • CallStackOf

This PR breaks backward compatibility.

Motivation

Enforce checking zero value.
For now, If we call XXXOf functions like CodeOf(err).ErrorCode(), It can panic!!
By adding bool into its returning value, developers must consider zero value.

@codecov-io
Copy link

codecov-io commented Jan 15, 2019

Codecov Report

Merging #18 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
+ Coverage   95.88%   95.91%   +0.03%     
==========================================
  Files           5        5              
  Lines         267      269       +2     
==========================================
+ Hits          256      258       +2     
  Misses          7        7              
  Partials        4        4
Impacted Files Coverage Δ
code.go 100% <100%> (ø) ⬆️
failure.go 100% <100%> (ø) ⬆️
wrapper.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32d7150...b604874. Read the comment docs.

true if data exists, false if no data exists
@morikuni morikuni merged commit b670d36 into master Jan 21, 2019
@morikuni morikuni deleted the return-bool branch January 21, 2019 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes Include breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants