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 new value binding methods (UnixTimeMilli,TextUnmarshaler,JSONUnmarshaler) to Valuebinder #2127

Merged
merged 2 commits into from Mar 17, 2022

Conversation

aldas
Copy link
Contributor

@aldas aldas commented Mar 13, 2022

Add new value binding methods (UnixTimeMilli,TextUnmarshaler,JSONUnmarshaler) to Valuebinder. As it adds only new methods to struct it is backwards compatible change.

  • UnixTimeMilli binds 1647184410140 to 2022-03-13T15:13:30.140000000+00:00 useful when dealing with Javascript

  • TextUnmarshaler binds value to destination implementing encoding.TextUnmarshaler interface

  • JSONUnmarshaler binds value to destination implementing json.Unmarshaler interface

Requested in #2000 (comment)

@codecov
Copy link

codecov bot commented Mar 13, 2022

Codecov Report

Merging #2127 (bfea350) into master (3f5b733) will increase coverage by 0.11%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2127      +/-   ##
==========================================
+ Coverage   92.10%   92.21%   +0.11%     
==========================================
  Files          37       37              
  Lines        3028     3071      +43     
==========================================
+ Hits         2789     2832      +43     
  Misses        150      150              
  Partials       89       89              
Impacted Files Coverage Δ
binder.go 100.00% <100.00%> (ø)
echo.go 95.17% <0.00%> (+0.03%) ⬆️
middleware/recover.go 85.00% <0.00%> (+0.78%) ⬆️

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 3f5b733...bfea350. Read the comment docs.

@aldas aldas requested a review from lammel March 13, 2022 16:05
@aldas
Copy link
Contributor Author

aldas commented Mar 15, 2022

@lammel please review

Copy link
Contributor

@lammel lammel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Fine work @aldas
Haven't had time to actually do some testing, but test cases look good anyway.

@aldas aldas merged commit 63c62bc into labstack:master Mar 17, 2022
@aldas aldas deleted the valuebinder_new_methods branch July 12, 2022 19:04
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.

None yet

2 participants