Skip to content

feat: support ignored value "-" for env tag#338

Merged
caarlos0 merged 2 commits intocaarlos0:mainfrom
sv-kozlov:ignored_support
Oct 11, 2024
Merged

feat: support ignored value "-" for env tag#338
caarlos0 merged 2 commits intocaarlos0:mainfrom
sv-kozlov:ignored_support

Conversation

@sv-kozlov
Copy link
Copy Markdown
Contributor

Support for ignoring a field when reading struct.
This is similar to using json:"-".
If the env tag of a field has the value "-", the field is always ignored.

Note, in the env tag, the value "-" can be set not only in place of the name, but also in the list of options.
This is done on the assumption of development convenience, so as not to remove the entire contents of the env tag.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1cb1967) to head (e213ff6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #338   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          524       529    +5     
=========================================
+ Hits           524       529    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caarlos0 caarlos0 merged commit 4ab8b37 into caarlos0:main Oct 11, 2024
@caarlos0
Copy link
Copy Markdown
Owner

thanks!

@sv-kozlov sv-kozlov deleted the ignored_support branch October 12, 2024 22:56
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