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

Required fields #50

Merged
merged 2 commits into from
Jun 14, 2020
Merged

Required fields #50

merged 2 commits into from
Jun 14, 2020

Conversation

ilyakaznacheev
Copy link
Owner

Add env-required flag to mark a field as required.

Close #46

@codecov
Copy link

codecov bot commented Jun 14, 2020

Codecov Report

Merging #50 into master will increase coverage by 0.24%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
+ Coverage   90.33%   90.57%   +0.24%     
==========================================
  Files           1        1              
  Lines         269      276       +7     
==========================================
+ Hits          243      250       +7     
  Misses         18       18              
  Partials        8        8              
Impacted Files Coverage Δ
cleanenv.go 90.57% <100.00%> (+0.24%) ⬆️

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 fec9bfa...47aa2e3. Read the comment docs.

@ilyakaznacheev ilyakaznacheev merged commit 4eefa52 into master Jun 14, 2020
@ilyakaznacheev ilyakaznacheev deleted the required-fields branch June 14, 2020 18:11
@dikkini
Copy link

dikkini commented Oct 30, 2020

Can you please add to README how to use this feature?

@ilyakaznacheev
Copy link
Owner Author

@dikkini
Copy link

dikkini commented Oct 30, 2020

I got an error:

Uploading Screenshot 2020-10-30 at 10.51.46.png…

@ilyakaznacheev
Copy link
Owner Author

Can't see your screenshot for some reason...

Feel free to create an issue about that with a description and a screenshot and we'll continue there.

@dikkini
Copy link

dikkini commented Oct 30, 2020

Screenshot 2020-10-30 at 10 51 46

@ilyakaznacheev
Copy link
Owner Author

It should be `env-required:"true"`

Example

@ilyakaznacheev
Copy link
Owner Author

So that Golang tag syntax requires you to provide tags in a key-value format. Here env-required is a key, and true is a value.

@dikkini
Copy link

dikkini commented Oct 30, 2020

it works. thanks. but in readme not this syntax.

@ilyakaznacheev
Copy link
Owner Author

Maybe I will include it to Godoc examples, thanks for the idea

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.

[Question] How to mark env variable as required?
2 participants