Skip to content

Fix non empty struct pointer value#236

Merged
caarlos0 merged 1 commit intocaarlos0:mainfrom
akutuev:non-struct-pointer
Sep 12, 2022
Merged

Fix non empty struct pointer value#236
caarlos0 merged 1 commit intocaarlos0:mainfrom
akutuev:non-struct-pointer

Conversation

@akutuev
Copy link
Copy Markdown
Contributor

@akutuev akutuev commented Sep 11, 2022

This is a fix for the bug #235

I can't understand the purpose of condition !refField.IsNil() but for this use case it was considering it as non empty value (line 229), calling ParseWithFuncs (line 234) and failing due to non struct type (line 190).

I have removed it and added extra tests for that use case and all UTs are ok

@caarlos0 can you please take a look?

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 11, 2022

Codecov Report

Merging #236 (47c223d) into main (69c7b5a) will increase coverage by 0.27%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main      #236      +/-   ##
===========================================
+ Coverage   99.72%   100.00%   +0.27%     
===========================================
  Files           2         2              
  Lines         358       356       -2     
===========================================
- Hits          357       356       -1     
+ Misses          1         0       -1     
Impacted Files Coverage Δ
env.go 100.00% <100.00%> (+0.28%) ⬆️

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

@akutuev akutuev marked this pull request as ready for review September 11, 2022 20:09
@caarlos0
Copy link
Copy Markdown
Owner

I don't remember why either, but, if all tests are passing, should be fine!

Thanks

@caarlos0 caarlos0 merged commit f3ddf1f into caarlos0:main Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants