goverter icon indicating copy to clipboard operation
goverter copied to clipboard

Add struct tag support for field matching

Open kb-sp opened this issue 1 year ago • 1 comments

This PR adds support for using struct tags to match variable names.

Feedback welcome!

Following up on #132 this adds a new option that takes the name of the tag to use for matching. For example:

// goverter:converter
// goverter:matchTag json

Tag matching is not performed if matchTag is not set, and matching falls back to standard code paths.

Docs have been updated, and functionality seems good on my code base.

kb-sp avatar Nov 09 '24 11:11 kb-sp

Codecov Report

Attention: Patch coverage is 71.69811% with 15 lines in your changes missing coverage. Please review.

Project coverage is 95.13%. Comparing base (076c25f) to head (ecdb0b6).

Files with missing lines Patch % Lines
xtype/type.go 65.11% 14 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
- Coverage   96.53%   95.13%   -1.40%     
==========================================
  Files          46       44       -2     
  Lines        2250     2715     +465     
==========================================
+ Hits         2172     2583     +411     
- Misses         53      109      +56     
+ Partials       25       23       -2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 09 '24 13:11 codecov[bot]