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 support encoding.TextUnmarshaler #123

Merged
merged 6 commits into from Jul 20, 2023

Conversation

mirecl
Copy link
Contributor

@mirecl mirecl commented Jul 7, 2023

Add support encoding.TextUnmarshaler for example:

type Config struct {
      LogLevel zapcore.Level `env:"LOG_LEVEL" env-default:"debug"`
}

Custom type zapcore.Level from zap implements interface encoding.TextUnmarshaler.

P.S. I am confident that this commit will be beneficial for the community.

@mirecl
Copy link
Contributor Author

mirecl commented Jul 7, 2023

@ilyakaznacheev, what do you think about it?

@ilyakaznacheev
Copy link
Owner

Thanks, I'll check

@clems71
Copy link

clems71 commented Jul 20, 2023

Seems definitely useful to me as well. For any type that inherently supports encoding.TextUnmarshaler , we'd better use that first. Plus it allows people to reuse types coming from an imported module as-is, without type def'ing a custom type for the sake of implementing SetValue .

@mirecl
Copy link
Contributor Author

mirecl commented Jul 20, 2023

@ilyakaznacheev, I am writing to inquire about the progress of the PR review. I understand that the review process can take time, but I wanted to check if there are any issues or problems that may be causing a delay.

@ilyakaznacheev ilyakaznacheev added the enhancement New feature or request label Jul 20, 2023
Copy link
Owner

@ilyakaznacheev ilyakaznacheev left a comment

Choose a reason for hiding this comment

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

Please add tests for this case.

README.md Outdated Show resolved Hide resolved
@mirecl
Copy link
Contributor Author

mirecl commented Jul 20, 2023

@ilyakaznacheev, done ✅

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #123 (a5a43ad) into master (aea2c89) will decrease coverage by 0.97%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
- Coverage   93.76%   92.79%   -0.97%     
==========================================
  Files           1        1              
  Lines         353      361       +8     
==========================================
+ Hits          331      335       +4     
- Misses         13       15       +2     
- Partials        9       11       +2     
Flag Coverage Δ
unittests 92.79% <76.92%> (-0.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cleanenv.go 92.79% <76.92%> (-0.97%) ⬇️

cleanenv.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
cleanenv.go Outdated Show resolved Hide resolved
@ilyakaznacheev ilyakaznacheev merged commit c35e574 into ilyakaznacheev:master Jul 20, 2023
22 of 23 checks passed
@mirecl
Copy link
Contributor Author

mirecl commented Jul 20, 2023

@ilyakaznacheev, when can we expect a new release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants