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

feat: add options #131

Merged
merged 26 commits into from
Jul 12, 2020
Merged

feat: add options #131

merged 26 commits into from
Jul 12, 2020

Conversation

caarlos0
Copy link
Owner

@caarlos0 caarlos0 commented Jul 10, 2020

based on #128:

  • removed decrypt
  • refactored options to not be a pointer (not sure why it was)
  • refactor the default options.Environment to be os.Environ, simplifying getOr

closes #128

cc/ @nuttmeister

@caarlos0 caarlos0 self-assigned this Jul 10, 2020
@codecov
Copy link

codecov bot commented Jul 10, 2020

Codecov Report

Merging #131 into master will increase coverage by 0.08%.
The diff coverage is 97.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   99.14%   99.23%   +0.08%     
==========================================
  Files           1        1              
  Lines         234      261      +27     
==========================================
+ Hits          232      259      +27     
  Misses          1        1              
  Partials        1        1              
Impacted Files Coverage Δ
env.go 99.23% <97.91%> (+0.08%) ⬆️

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 3ac02fe...6fe5291. Read the comment docs.

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
@caarlos0 caarlos0 merged commit 52290f9 into master Jul 12, 2020
@caarlos0 caarlos0 deleted the add-options branch July 12, 2020 18:24
nexoscp added a commit to nexoscp/env that referenced this pull request Apr 7, 2022
* Add support for decrypting vars.

* Changed from WithEncryption to WithDecrypt.

* Moved common functions.

* Added tests.

* added support for decrypting content of file.

* updated tests to support decrypt of file content.

* updated readme with info about decrypt.

* Fixed typos in readme.

* check if decryptor is nil.

* increased coverage.

* updated example to use real life example.

* increased code coverage.

* added test for failing on inner struct.

* removed commented copy/paste test.

* added support for options.
added decryptor support.
added set env support.

* updated name of test.
removed commented test no longer needed.

* changed to not actually setting env vars when supplying env map.

* added support for changing tag name.

* made options not mandatory.

* removed required from JSON tag.

* added required and envDefault.

* fix: remove decryptor

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: no need to be a pointer

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: added back missing test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: os.Environ

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* docs: readme

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

Co-authored-by: Anders Wallin <touch.dev.null@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants